Package-level declarations
Types
Link copied to clipboard
interface BucketStateMap
Interface the provides a map implementation to store the state of the rate limiter.
Link copied to clipboard
Implementation of StateStorage that stores the state in memory.
Link copied to clipboard
A builder for MemoryStateStorage instances.
Link copied to clipboard
A builder for MemoryStateStorage instances with eviction.
Link copied to clipboard
Simple in-memory implementation of BucketStateMap. This implementation is thread-safe and uses ConcurrentHashMap to store the state.
Link copied to clipboard
class SimpleBucketStateMapWithEviction(clock: Clock, stateMap: SimpleBucketStateMap = SimpleBucketStateMap(), ttlAfterLastAccess: Duration = 2.hours, expirationCheckInterval: Duration = 10.minutes, coroutineScope: CoroutineScope = CoroutineScope(Dispatchers.Default)) : BucketStateMap
A simple in-memory state map implementation that expires keys after a given time-to-live.
Functions
Link copied to clipboard
Creates a MemoryStateStorage instance.
Link copied to clipboard
fun memoryStateStorageWithEviction(init: MemoryStateStorageWithEvictionBuilder.() -> Unit = {}): StateStorage
Creates a MemoryStateStorage instance with eviction.