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
See morecancel
is called.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
See morecatch
. Usefinally
to specify a code block that executes when the promise chain resolves.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, thecancelValue
optional parameter explicitly specifies a value to use when the guarantee is cancelled.See
Thenable
Declaration
Swift
public class CancellableGuarantee<T> : CancellableThenable
-
A
CancellablePromise
is a functional abstraction around a failable and cancellable asynchronous operation.At runtime the promise can become a member of a chain of promises, where the
See morecancelContext
is used to track and cancel (if desired) all promises in this chain.Declaration
Swift
public class CancellablePromise<T> : CancellableThenable, CancellableCatchMixin