Type Alias IRateLimiterAdapterState

IRateLimiterAdapterState: {
    attempt: number;
    resetTime: TimeSpan;
    success: boolean;
}

Low-level state snapshot for rate limiter operations. Provides the current quota tracking metrics at the adapter level. Contains information about success status, attempt count, and reset timing.

IMPORT_PATH: "@daiso-tech/core/rate-limiter/contracts"

Type declaration

  • attempt: number

    Sequential attempt number tracking usage in the current window. Incremented on each call to updateState, regardless of success.

  • resetTime: TimeSpan

    Time span until the rate limiter resets to initial state. Attempts counter and blocking status will reset after this duration.

  • success: boolean

    Indicates whether the attempt was successful (allowed) or blocked.

    • true: Request was allowed, counter incremented
    • false: Request was blocked due to limit being reached