Expand description
token-bucket
Zero-dependency, lock-free atomic GCRA, Fixed-Window, Token-Bucket, and 64-way sharded bounded keyed rate-limiting engine.
Structs§
- Fixed
Window Cell - Lock-free single-
AtomicU64fixed-window state cell packing(window_id, count). - Fixed
Window Config - Immutable configuration for a lock-free atomic fixed-window rate limiter.
- Fixed
Window Limiter - Lock-free atomic fixed-window rate limiter with an embedded monotonic clock.
- Gcra
Cell - Lock-free single-
AtomicU64GCRA state cell usable standalone or inside sharded maps. - Gcra
Config - Immutable configuration for a GCRA (Generic Cell Rate Algorithm) limiter.
- Gcra
Limiter - Lock-free atomic GCRA rate limiter with an embedded monotonic nanosecond clock.
- Keyed
Rate Limiter - 64-way cache-line-aligned sharded, bounded, lock-free-CAS keyed rate limiter.
- Monotonic
Clock - Monotonic nanosecond clock anchored at limiter creation time.
- Rate
Limit Decision - Outcome of a rate-limit evaluation with exact nanosecond reset and retry timings.
- Token
Bucket Cell - Lock-free single-
AtomicU64token-bucket state cell packing(last_step, tokens). - Token
Bucket Config - Immutable configuration for a lock-free atomic token-bucket rate limiter.
- Token
Bucket Limiter - Lock-free atomic token-bucket rate limiter with an embedded monotonic clock.
Enums§
- Rate
Limit Error - Configuration validation errors returned by rate-limiter constructors.
- Rate
Limit Policy - Unified rate-limiting algorithm policy applied to every key in a
KeyedRateLimiter.
Constants§
- KEYED_
SHARD_ COUNT - Number of cache-line-aligned shards in
KeyedRateLimiter. - MAX_
FIXED_ WINDOW_ LIMIT - Maximum per-window request limit supported by single-atomic packed fixed-window state.
- MAX_
TOKEN_ BUCKET_ CAPACITY - Maximum token-bucket capacity supported by single-atomic packed state.