class

Fetcher::TokenBucketRateLimiter

Inherits Reference < Object

Constants

CRASH_BACKOFF_INTERVALS = [100, 500, 1000, 5000]

Backoff intervals for retry on fiber crashes (in milliseconds)

DEFAULT_CRASH_BACKOFF = 5000

Constructors

new(capacity : Float64, refill_rate : Float64, max_waiters : Int32 = 1000)
Source

Instance methods

acquire(tokens : Float64 = 1.0)
Source
available_tokens
Source
try_acquire(tokens : Float64 = 1.0) : Bool
Source

Nested types