Type Alias RateLimiterBlockedState

RateLimiterBlockedState: {
    exceedAttempts: number;
    limit: number;
    retryAfter: TimeSpan;
    totalAttempts: number;
    type: typeof RATE_LIMITER_STATE["BLOCKED"];
}

Represents a rate limiter state where requests are being blocked. The configured limit has been exceeded and the rate limiter is preventing further requests. This state includes metrics about the excess and when the block will be lifted.

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

Type declaration

  • exceedAttempts: number

    Number of attempts that exceeded the configured limit. Calculated as (totalAttempts - limit), represents the overage amount.

  • limit: number

    Maximum number of allowed attempts in the current time window. This is the threshold that was exceeded, triggering the blocked state.

  • retryAfter: TimeSpan

    Time duration until the rate limiter returns to ALLOWED or EXPIRED state. After this time span elapses, new requests will be allowed and counters reset.

  • totalAttempts: number

    Total number of attempts that have been made (including those over the limit). Shows the full count of requests attempted before and after blocking began.

  • type: typeof RATE_LIMITER_STATE["BLOCKED"]

    Discriminator for the BLOCKED state.