Dispatcher
public protocol Dispatcher
A PromiseKit
abstraction of a DispatchQueue
that allows for a more
flexible variety of implementations. (For technical reasons,
DispatchQueue
itself cannot be subclassed.)
Dispatcher
s define a dispatch
method that executes a supplied closure.
Execution may be synchronous or asynchronous, serial
or concurrent, and can occur on any thread.
All DispatchQueue
s are also valid Dispatcher
s.
-
dispatch(_:
Default implementation) Undocumented
Default Implementation
Executes the provided closure on a
Dispatcher
, yielding aPromise
that represents the value ultimately returned by the closure.dispatcher.dispatch { try md5(input) }.done { md5 in //… }
Declaration
Swift
func dispatch(_ body: @escaping () -> Void)