class RateLimiter::Limiter
- RateLimiter::Limiter
- Reference
- Object
Overview
A rate limiter erogating tokens at the specified rate.
This is powered by the token bucket algorithm.
Included Modules
Defined in:
rate_limiter.crConstructors
Instance Method Summary
- #bucket : Channel(Nil)
- #get(max_wait : Time::Span) : Token | Timeout
-
#get : Token
Returns a
Token
as soon as available. - #rate : Float64
Instance methods inherited from module RateLimiter::LimiterLike
get(max_wait : Time::Span) : Token | Timeoutget : Token get, get!(max_wait : Time::Span) : Token
get! : Token get!, get? : Token? get?
Constructor Detail
Instance Method Detail
Description copied from module RateLimiter::LimiterLike
Returns a Token
if one is available within max_wait
time,
otherwise it returns a Timeout
. Blocking.
Description copied from module RateLimiter::LimiterLike
Returns a Token
as soon as available. Blocking.