@jiminp/tooltool
    Preparing search index...

    Interface RateLimitedFunction<ArgsType, ReturnType>

    A function wrapper returned by rateLimited that enforces a minimum delay between consecutive executions.

    interface RateLimitedFunction<ArgsType extends unknown[], ReturnType> {
        get limit_duration_ms(): number;
        get processing_count(): number;
        get wait_count(): number;
        (...args: ArgsType): Promise<ReturnType>;
    }

    Type Parameters

    • ArgsType extends unknown[]

      The tuple type of the wrapped function's parameters.

    • ReturnType

      The resolved type returned by the wrapped function.

    • Invokes the wrapped function. If the rate limit is currently active, the call is queued and executed in first-come first-served order.

      Parameters

      Returns Promise<ReturnType>

      A promise resolving to the wrapped function's return value.

    Index

    Accessors

    • get limit_duration_ms(): number

      The current delay (in milliseconds) enforced between calls. If a dynamic duration provider was given to rateLimited, this value is computed on demand.

      Returns number

    • get processing_count(): number

      The current number of calls being processed.

      Returns number

    • get wait_count(): number

      The current number of queued, not-yet-executed calls.

      Returns number