Concurrency-TS Documentation
    Preparing search index...

    Interface Concurrency

    The Concurrency API

    interface Concurrency {
        completeLater<T>(
            onCompletion: OnCompletion<T>,
            delegate: RequiredType<Type<OnCompletion<T>>>,
        ): void;
        completeNow<T>(
            onCompletion: OnCompletion<T>,
            successBlock: RequiredType<Type<T>>,
        ): OptionalType<T>;
        createCompletable<T>(config: Config<T>): Completable<T>;
        createStateMachine<T>(config: Config<T>): StateMachine<T>;
        createWaitable<T>(config: Config<T>): Waitable<T>;
        open(): AutoClose;
    }

    Hierarchy

    • Open
      • Concurrency
    Index

    Methods

    • Guaranteed execution: complete later block. Either the delegate successfully takes ownership of the OnCompletion or a final FAILED completion is dispatched

      Type Parameters

      • T

        the completion value type

      Parameters

      • onCompletion: OnCompletion<T>

        the OnCompletion callback

      • delegate: RequiredType<Type<OnCompletion<T>>>

        the intended delegate to receive the OnCompletion

      Returns void

    • Guaranteed execution: complete now block When this method finishes, it is guaranteed the OnCompletion will have received a final completion. Exceptions will result in a FAILED completion Exceptions will be rethrown.

      Type Parameters

      • T

        the completion value type

      Parameters

      • onCompletion: OnCompletion<T>

        the OnCompletion callback

      • successBlock: RequiredType<Type<T>>

        executed to determine the final completion value for an activity

      Returns OptionalType<T>

      the final completion value

    • Create a new Completable

      Type Parameters

      • T

        the type of completion value

      Parameters

      • config: Config<T>

        the completable configuration

      Returns Completable<T>

      the new Completable

    • Create a new StateMachine

      Type Parameters

      • T

        the type of each state

      Parameters

      • config: Config<T>

        the state machine configuration

      Returns StateMachine<T>

      the new StateMachine

      IllegalArgumentException if initialState is null

    • Create a new Waitable with the given configuration

      Type Parameters

      • T

        the type of waitable

      Parameters

      • config: Config<T>

        the waitable configuration

      Returns Waitable<T>

      the waitable

    • Open this instance.

      Returns AutoClose

      the mechanism to close