firefly-limiter - v1.0.1
    Preparing search index...

    Class Bulkhead

    Bounds how many calls may be in flight at once, and how many may wait.

    A bulkhead is the thing that keeps one slow dependency from consuming every connection, socket or worker the process has; it belongs directly around the work, where the count it holds is the count that matters.

    Waiting for a slot ends early if the caller's signal aborts, so a queued call does not outlive the request that made it, and the queue is served in order: a slot is handed to whoever has waited longest rather than to whoever happens to ask next.

    Index
    policy: Policy = ...

    Takes a slot before the work starts and gives it back when the work settles.

    • get concurrency(): number

      Calls allowed at once, which moves on its own when the bulkhead adapts.

      Returns number

    • get inFlight(): number

      Calls currently running.

      Returns number

    • get queued(): number

      Calls currently waiting for a slot.

      Returns number