WaitQueue Class

    Package: @esfx/async-waitqueue

    An async coordination primitive that provides a queue of Promises.

    Declaration
    export declare class WaitQueue<T> 

    Properties

    size

    Gets the number of pending entries in the queue.

    Declaration
    get size(): number;
    Property Value
    number

    Methods

    cancelAll(reason)

    Rejects all pending wait() operations with a CancelError.

    Declaration
    cancelAll(reason?: CancelError): number;
    Parameters
    reason
    CancelError

    Returns
    number

    The number of pending wait() operations that were rejected.

    cancelOne(reason)

    Rejects the next pending wait() operation with a CancelError.

    Declaration
    cancelOne(reason?: CancelError): boolean;
    Parameters
    reason
    CancelError

    Returns
    boolean

    true if a pending wait() operation was rejected; otherwise, false.

    rejectAll(reason)

    Rejects all pending wait() operations with the provided reason.

    Declaration
    rejectAll(reason: unknown): number;
    Parameters
    reason
    unknown

    Returns
    number

    The number of pending wait() operations that were rejected.

    rejectOne(reason)

    Rejects the next pending wait() operation with the provided reason.

    Declaration
    rejectOne(reason: unknown): boolean;
    Parameters
    reason
    unknown

    Returns
    boolean

    true if a pending wait() operation was rejected; otherwise, false.

    resolveAll(this)

    Resolves all pending wait() operations with the provided value.

    Declaration
    resolveAll(this: WaitQueue<void>): number;
    Parameters
    this
    WaitQueue<void>

    Returns
    number

    The number of pending wait() operations that were resolved.

    resolveAll(value)

    Resolves all pending wait() operations with the provided value.

    Declaration
    resolveAll(value: T | PromiseLike<T>): number;
    Parameters
    value
    T | PromiseLike<T>

    Returns
    number

    The number of pending wait() operations that were resolved.

    resolveOne(this)

    Resolves a pending wait() operation with the provided value.

    Declaration
    resolveOne(this: WaitQueue<void>): boolean;
    Parameters
    this
    WaitQueue<void>

    Returns
    boolean

    true if a pending wait() operation was resolved; otherwise, false.

    resolveOne(value)

    Resolves a pending wait() operation with the provided value.

    Declaration
    resolveOne(value: T | PromiseLike<T>): boolean;
    Parameters
    value
    T | PromiseLike<T>

    Returns
    boolean

    true if a pending wait() operation was resolved; otherwise, false.

    wait(cancelable)

    Returns a Promise for the next value to be added to the queue.

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

    A Cancelable used to cancel the request.

    Returns
    Promise<T>

    Generated by DocFX