Class AsyncSemaphore

Async semaphore To create critical sections of async functions

Hierarchy

  • AsyncSemaphore

Constructors

Properties

Methods

Constructors

Properties

destroyed: boolean
instances: number
waiting: Waiter[]

Methods

  • Acquire instances

    Parameters

    • Optional instances: number

      Number of instances

    Returns Promise<void>

  • Destroys the semaphore. All functions waiting for it will receive a promise rejection.

    Returns void

  • Release instances

    Parameters

    • Optional instances: number

      Number of instances

    Returns void

Generated using TypeDoc