A limiter: something that counts hits against a key and says whether one may proceed.
The limit is passed in rather than held by the limiter, deliberately. An implementation that can
refuse atomically, through a conditional write, has to know the limit to express the condition,
and refusing without writing is what stops a flood from costing one write per rejected request.
A limiter that increments and then compares pays for every refusal and lets the counter climb
without bound inside the window.
A limiter: something that counts hits against a key and says whether one may proceed.
The limit is passed in rather than held by the limiter, deliberately. An implementation that can refuse atomically, through a conditional write, has to know the limit to express the condition, and refusing without writing is what stops a flood from costing one write per rejected request. A limiter that increments and then compares pays for every refusal and lets the counter climb without bound inside the window.