Classes

The following classes are available globally.

  • Keeps track of all promises in a promise chain with pending or currently running tasks, and cancels them all when cancel is called.

    See more

    Declaration

    Swift

    public class CancelContext : Hashable
  • Tracks the cancel items for a CancellablePromise. These items are removed from the associated CancelContext when the promise resolves.

    Declaration

    Swift

    public class CancelItemList
  • Cancellable finalizer returned from catch. Use finally to specify a code block that executes when the promise chain resolves.

    See more

    Declaration

    Swift

    public class CancellableFinalizer
  • A CancellableGuarantee is a functional abstraction around an asynchronous operation that can be cancelled but cannot error.

    When a cancellable guarantee is cancelled any associated tasks are cancelled but the chain completes successfully. In this situation the guarantee would successfully resolve with whatever value the task returns after being cancelled – perhaps an error, nil, an empty string, or a zero length array. Alternatively, the cancelValue optional parameter explicitly specifies a value to use when the guarantee is cancelled.

    See

    Thenable
    See more

    Declaration

    Swift

    public class CancellableGuarantee<T> : CancellableThenable