TKMCancellationTokens

public class TKMCancellationTokens

Undocumented

  • A cancellation token that will never be cancelled.

    Declaration

    Swift

    public static let None: TKMCancellationToken
  • Creates a cancellation token that goes into cancelled state if at least one of the specified tokens goes into cancelled state.

    Declaration

    Swift

    public static func any(_ tokens: [TKMCancellationToken]) -> TKMCancellationToken

    Parameters

    tokens

    tokens the source cancellation tokens.

    Return Value

    a cancellation token that goes into cancelled state if at least one of the specified tokens goes into cancelled state.

  • Creates a cancellation token that goes into cancelled state when either the specified timeout period elapsed or the specified token goes into cancelled state, whatever happens first.

    Declaration

    Swift

    public static func withTimeout(original: TKMCancellationToken, timeoutMs: Int32) -> TKMCancellationToken

    Parameters

    original

    the original token to observ.

    timeoutMs

    the timeout period in milliseconds.

    Return Value

    a cancellation token that goes into cancelled state when either the specified timeout period elapsed or the specified token goes into cancelled state, whatever happens first.

  • Creates a cancellation token that goes into cancelled state after the specified timeout period elapsed.

    Declaration

    Swift

    public static func fromTimeout(timeoutMs: Int32) -> TKMCancellationToken

    Parameters

    timeoutMs

    the timeout period in milliseconds.

    Return Value

    a cancellation token that goes into cancelled state after the specified timeout period elapsed.