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 Swift does not expose dispatch_once et al. which is what we used to use in order to make the configuration immutable once first used.

    See more

    Declaration

    Swift

    public struct PMKConfiguration
  • A Dispatcher that bundles a DispatchQueue with a DispatchGroup, a set of DispatchWorkItemFlags, and a quality-of-service level. Closures dispatched through this Dispatcher will be submitted to the underlying DispatchQueue with the supplied components.

    See more

    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 PromiseKit‘s default dispatching behavior to this mode by setting conf.Q.map and/or conf.Q.return to nil. (This is the same as assigning an instance of CurrentThreadDispatcher to these variables.)

    See more

    Declaration

    Swift

    public struct CurrentThreadDispatcher : Dispatcher
  • A Dispatcher that dispatches onto the threads associated with NSManagedObjectContexts, allowing Core Data operations to be handled using promises.

    See more

    Declaration

    Swift

    public struct CoreDataDispatcher : Dispatcher