Skip to content
Josh Wright edited this page Jan 14, 2021 · 3 revisions

Thread

A utility for running expensive CPU work on threads so as not to block the current EventLoop.

public struct Thread

Methods

run(_:)

Runs an expensive bit of work on a thread that isn't backing an EventLoop, returning any value generated by that work back on the current EventLoop.

public static func run<T>(_ task: @escaping () throws -> T) -> EventLoopFuture<T>

Parameters

  • task: The work to run.

Returns

A future containing the result of the expensive work that completes on the current EventLoop.

Alchemy
Types
Protocols
Global Typealiases
Global Variables
Global Functions
Fusion
Types
Protocols
Papyrus
Types
Protocols
Clone this wiki locally