Std.RateLimiter
6 public declarations
- AcquireResult
Result of an acquisition attempt containing the updated limiter and success status.
- availableTokens
&Std.RateLimiter.RateLimiter -> UInt64 -> IntReturns the number of whole tokens currently available.
- create
Int -> Int -> Std.RateLimiter.RateLimiterCreates a rate limiter with a refill rate of `ratePerSec` and capacity `burstCapacity`.
- RateLimiter
A bucket is a value, so where it is kept decides what it limits.
- reset
&Std.RateLimiter.RateLimiter -> UInt64 -> Std.RateLimiter.RateLimiterResets tokens to maximum burst capacity at the given timestamp.
- tryAcquire
&Std.RateLimiter.RateLimiter -> Int -> UInt64 -> Std.RateLimiter.AcquireResultAttempts to acquire `tokens` at `currentMicros`.
