Expand description
Sliding-window request-count rate limiter for GraphQL API targets.
Limits outgoing requests to max_requests in any rolling window duration.
Before each request rate_limit_acquire is called; it records the current
timestamp and sleeps until the oldest in-window request expires if the
window is already full.
A server-returned Retry-After value can be applied via
rate_limit_retry_after, which imposes a hard block until the indicated
instant irrespective of the sliding window state.
Operates in parallel with graphql_throttle
(leaky-bucket cost throttle). Both can be active simultaneously.
Re-exports§
pub use crate::ports::graphql_plugin::RateLimitConfig;
Structs§
- Request
Rate Limit - Shareable, cheaply-cloneable handle to a per-plugin sliding-window limiter.
Functions§
- parse_
retry_ after - Parse an integer
Retry-Aftervalue from a header string. - rate_
limit_ acquire - Sleep until a request slot is available within the rolling window, then record the slot.
- rate_
limit_ retry_ after - Record a server-returned
Retry-Afterdelay.