Logos DX
    Preparing search index...

    Interface RateLimitPolicyState<S, H, P>

    Extended internal state for rate limit policy. Includes rate limit-specific fields and token bucket management.

    interface RateLimitPolicyState<S, H, P> {
        enabled: boolean;
        maxCalls: number;
        methods: Set<string>;
        rateLimiters: Map<string, RateLimitTokenBucket>;
        rulesCache: Map<string, RateLimitRule<S, H, P> | null>;
        serializer: RequestSerializer<S, H, P>;
        waitForToken: boolean;
        windowMs: number;
    }

    Type Parameters

    • S
    • H
    • P
    Index

    Properties

    enabled: boolean

    Whether the policy is globally enabled

    maxCalls: number

    Max calls per window

    methods: Set<string>

    Set of HTTP methods this policy applies to

    rateLimiters: Map<string, RateLimitTokenBucket>

    Token buckets by key

    rulesCache: Map<string, RateLimitRule<S, H, P> | null>

    Memoized rule cache: method:path -> resolved rule or null

    serializer: RequestSerializer<S, H, P>

    The serializer function for bucket key generation

    waitForToken: boolean

    Whether to wait for token vs reject immediately

    windowMs: number

    Window duration in milliseconds