CancellableFinalizer
public class CancellableFinalizer
Cancellable finalizer returned from catch. Use finally to specify a code block that executes when the promise chain resolves.
-
The CancelContext associated with this finalizer
Declaration
Swift
public let cancelContext: CancelContext -
finallyis the same asensure, but it is not chainableDeclaration
Swift
@discardableResult public func finally(on: DispatchQueue? = conf.Q.return, flags: DispatchWorkItemFlags? = nil, _ body: @escaping () -> Void) -> CancelContext -
Cancel all members of the promise chain and their associated asynchronous operations.
Declaration
Swift
public func cancel(error: Error? = nil)Parameters
errorSpecifies the cancellation error to use for the cancel operation, defaults to
PMKError.cancelled -
True if all members of the promise chain have been successfully cancelled, false otherwise.
Declaration
Swift
public var isCancelled: Bool { get } -
True if
cancelhas been called on the CancelContext associated with this promise, false otherwise.cancelAttemptedwill be true ifcancelis called on any promise in the chain.Declaration
Swift
public var cancelAttempted: Bool { get } -
The cancellation error generated when the promise is cancelled, or
nilif not cancelled.Declaration
Swift
public var cancelledError: Error? { get }
View on GitHub
Install in Dash
CancellableFinalizer Class Reference