class

MartenThrottle::FixedWindow

Inherits MartenThrottle::Strategy < Reference < Object

Fixed-window counter. One bucket per window, identified by floor(now / window). Allows up to limit requests per bucket; a single client can therefore burst up to 2 * limit at the boundary between two buckets. Cheap: one cache increment per request.

Instance methods

check(key : String, limit : Int32, window : Time::Span) : Result
Source