Package-level declarations
Types
Link copied to clipboard
abstract class AbstractIntervalRateLimiter(val limit: Int, val interval: Duration) : IntervalRateLimiter
Abstract base class for implementing IntervalRateLimiter.
Link copied to clipboard
A RateLimiter that restricts the number of consume invocations in intervals to a given limit. Exceeding this limit results in suspension until the next interval.
Link copied to clipboard
interface RateLimiter
A rate limiter that limits the number of consume invocations that can be made over a certain period.
Functions
Link copied to clipboard
fun IntervalRateLimiter(limit: Int, interval: Duration, timeSource: TimeSource = TimeSource.Monotonic): IntervalRateLimiter
Creates an implementation of IntervalRateLimiter that uses a TimeSource for measuring intervals.
Creates an implementation of IntervalRateLimiter that uses a Clock for measuring intervals.