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

    Interface RateLimiterOptions

    Configuration for a RateLimiter.

    interface RateLimiterOptions {
        capacity: number;
        clock?: Clock;
        onEvent?: EventSink;
        onExhausted?: "wait" | "reject";
        perSecond: number;
    }
    Index
    capacity: number

    Bucket size, which is the largest burst allowed after an idle period.

    clock?: Clock

    Defaults to the system clock.

    onEvent?: EventSink

    Receives a rate-limited event whenever a call finds the bucket empty.

    onExhausted?: "wait" | "reject"

    What to do when the bucket is empty: wait for a token, or refuse the call with a RateLimitError. Defaults to "wait".

    perSecond: number

    Tokens added per second.