Other Structures
The following structures are available globally.
-
PromiseKit’s configurable parameters.
Do not change these after any Promise machinery executes as the configuration object is not thread-safe.
We would like it to be, but sadly
See moreSwift
does not exposedispatch_once
et al. which is what we used to use in order to make the configuration immutable once first used.Declaration
Swift
public struct PMKConfiguration
-
A
See moreDispatcher
that bundles aDispatchQueue
with aDispatchGroup
, a set ofDispatchWorkItemFlags
, and a quality-of-service level. Closures dispatched through thisDispatcher
will be submitted to the underlyingDispatchQueue
with the supplied components.Declaration
Swift
public struct DispatchQueueDispatcher : Dispatcher
-
A
Dispatcher
class that executes all closures synchronously on the current thread.Useful for temporarily disabling asynchrony and multithreading while debugging
PromiseKit
chains.You can set
See morePromiseKit
‘s default dispatching behavior to this mode by settingconf.Q.map
and/orconf.Q.return
tonil
. (This is the same as assigning an instance ofCurrentThreadDispatcher
to these variables.)Declaration
Swift
public struct CurrentThreadDispatcher : Dispatcher
-
A
See moreDispatcher
that dispatches onto the threads associated withNSManagedObjectContext
s, allowing Core Data operations to be handled using promises.Declaration
Swift
public struct CoreDataDispatcher : Dispatcher