State is two numbers: the token count and the last refill time. A leaky bucket used as a meter makes the same decisions.
Token bucket
A limiter that refills tokens at a fixed rate and spends one per request, allowing bursts up to its capacity.
State is two numbers: the token count and the last refill time. A leaky bucket used as a meter makes the same decisions.