Package-level declarations

Types

Link copied to clipboard
class KeyedRateLimiter<Key>(val config: RateLimiterConfig = defaultRateLimiterConfig(), val semaphoreStateFactory: () -> SemaphoreState = { InMemorySemaphoreState() }) : AutoCloseable

Manages multiple RateLimiter instances based on a Key, allowing rate limiting based on different keys. This is useful when you want to rate limit different resources or operations separately.

Link copied to clipboard
class RateLimiter(val config: RateLimiterConfig = defaultRateLimiterConfig(), val semaphoreState: SemaphoreState = InMemorySemaphoreState()) : FlowEventListenerImpl<RateLimiterEvent> , SuspendableSemaphore, AutoCloseable

The Rate Limiter is a proactive resilience mechanism that can be used to limit the number of requests that can be made to a system component, thereby controlling the consumption of resources and protecting the system from overloading. A rate limiter is initialized with a configuration that, through pre-configured policies, defines its behaviour.