Skip to main content

Module rate_limit

Module rate_limit 

Source
Expand description

Token-bucket rate limiting plugin (rate-limit).

Maintains one in-memory token bucket per client key (remote address or a configured header) in a concurrent DashMap; requests that find the bucket empty are rejected with 429 through the node’s error port.

Structs§

RateLimitPlugin
Enforces a per-client request rate using the token bucket algorithm.
TokenBucket 🔒
Classic token bucket: refilled continuously based on elapsed time, capped at max_tokens; each request consumes one token.

Enums§

KeySource 🔒
Source of the rate-limiting key for a request.