AnyCancellationToken

public final class AnyCancellationToken
extension AnyCancellationToken: Cancellable

Concrete type-erased implementation of Cancellable. It forwards its cancel() invocation to a block.

  • Creates a new token.

    Declaration

    Swift

    public init(body: (() -> Void)? = nil)

    Parameters

    body

    A block to forward the cancel() invocation to. The block is released when cancel() is invoked.

  • Declaration

    Swift

    public var isCancelled: Bool { get }
  • Declaration

    Swift

    public func cancel()