Atomic Bucket

Fast single node rate limiter implementing Token Bucket algorithm. The goal is to provide dependable solution that JustWorks™ with a focus on performance, correctness and ease of use. Bucket data is stored using :atomics module. Bucket references are stored in ETS and optionally cached as persistent terms.
Features
-
lock-free and race-free with compare-and-swap operations
-
BlazingFast™ performance, see benchmarks section in the readme. Req/s go brrrrrr
-
monotonic timer for correct calculations
-
millisecond tick supporting wider range of parameters and preventing request starvation
-
automatic calculation of bucket parameters based on average rate and burst size
-
handy timeouts for retries
-
compile-time validation of arguments when possible
-
only fixed request cost is supported for now






















