AsyncCountdownEvent Class

    Package: @esfx/async-countdown

    An event that is set when all participants have signaled.

    Declaration
    export declare class AsyncCountdownEvent 

    Constructors

    constructor(initialCount)

    Initializes a new instance of the CountdownEvent class.

    Declaration
    constructor(initialCount: number);
    Parameters
    initialCount
    number

    The initial participant count.

    Properties

    initialCount

    Gets the number of signals initially required to set the event.

    Declaration
    get initialCount(): number;
    Property Value
    number

    remainingCount

    Gets the number of remaining signals required to set the event.

    Declaration
    get remainingCount(): number;
    Property Value
    number

    Methods

    add(count)

    Increments the event's current count by one or more.

    Declaration
    add(count?: number): void;
    Parameters
    count
    number

    An optional count specifying the additional number of signals for which the event will wait.

    Returns
    void

    reset(count)

    Resets the remaining and initial count to the specified value, or the initial count.

    Declaration
    reset(count?: number): void;
    Parameters
    count
    number

    An optional count specifying the number of required signals.

    Returns
    void

    signal(count)

    Registers one or more signals with the CountdownEvent, decrementing the remaining count.

    Declaration
    signal(count?: number): boolean;
    Parameters
    count
    number

    An optional count specifying the number of signals to register.

    Returns
    boolean

    wait(cancelable)

    Asynchronously waits for the event to become signaled.

    Declaration
    wait(cancelable?: Cancelable): Promise<void>;
    Parameters
    cancelable
    Cancelable

    An optional Cancelable used to cancel the request.

    Returns
    Promise<void>

    Generated by DocFX