Constructors

  • Parameters

    • count: number

      The number of times countDown must be invoked before promises returned by await are resolved.

    Returns CountDownLatch

Methods

  • Waits until the count reaches zero.

    Parameters

    • Optional timeout: number

      The optional maximum time to wait, in milliseconds.

    Returns Promise<void>

    A promise that isn't resolved until the count reaches zero.

    If a timeout is given and it expires, the promise will be rejected.

  • Decreases the count by one. If the count reaches zero, all promises returned by the await methods will be resolved. If the count was already zero nothing happens.

    Returns void

  • Returns number

    The current count; never negative.

  • Returns number

    The initial count.

  • Returns string