@ac-essentials/misc-util
    Preparing search index...

    Class Signal

    A synchronization primitive that can be in a signaled or non-signaled state.

    When the signal is in the signaled state, calls to wait will resolve immediately. When the signal is in the non-signaled state, calls to wait will block until the signal is signaled.

    If autoReset is true, the signal will automatically reset to the non-signaled state after a single waiter is released. If autoReset is false, the signal will remain in the signaled state until it is manually reset.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Accessors

    Methods

    • Wait for the signal to be signaled.

      If the signal is already signaled, the listener is called immediately. If autoReset is true, the signal is reset to non-signaled state after notifying a listener.

      Note: If multiple listeners are waiting and the signal is signaled, only one listener will be notified if autoReset is true. If autoReset is false, all listeners will be notified.

      Parameters

      • Optionalsignal: null | AbortSignal

        An AbortSignal that can be used to cancel the wait operation.

      Returns Promise<void>

      A promise that resolves when the signal is signaled, or rejects when aborted.