Skip to main content

Module rate_limit

Module rate_limit 

Source

Structs§

RateLimiter
A sliding-window per-key rate limiter.
RedisRateLimiter
A distributed, fixed-window rate limiter backed by a Redis server.

Functions§

global
Return the process-wide rate limiter, initialized from environment variables.
is_configured
true when the operator set a global rate limit (RWS_CONFIG_RATE_LIMIT_MAX_REQUESTS, e.g. [rate_limit] max_requests in rws.config.toml) to a positive number. The rws binary enforces global() only then — an unset limit means “no global limit”, not “the 1000/60s default”.