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 morecancelis 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. Usefinallyto specify a code block that executes when the promise chain resolves.Declaration
Swift
public class CancellableFinalizer
-
A
CancellableGuaranteeis 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, thecancelValueoptional parameter explicitly specifies a value to use when the guarantee is cancelled.See moreSee
ThenableDeclaration
Swift
public class CancellableGuarantee<T> : CancellableThenable
-
A
CancellablePromiseis 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 morecancelContextis used to track and cancel (if desired) all promises in this chain.Declaration
Swift
public class CancellablePromise<T> : CancellableThenable, CancellableCatchMixin
View on GitHub
Install in Dash
Classes Reference