module RateLimiter::LimiterLike
Overview
Defines the API for a rate-limiter-like instance.
Direct including types
Defined in:
rate_limiter.crInstance Method Summary
- #get(max_wait : Time::Span) : Token | Timeout
-
#get : Token
Returns a
Token
as soon as available. -
#get!(max_wait : Time::Span) : Token
Raises
RateLimiter::Timeout
if no token is available after the given time span. -
#get! : Token
Raises
RateLimiter::Timeout
if no token is available at call time. -
#get? : Token?
Returns
nil
if no token is available at call time.
Instance Method Detail
Raises RateLimiter::Timeout
if no token is available after the given
time span. Blocking for at most a max_wait
duration.