RateLimiterRegistry

Registry for managing multiple named rate limiters.

Example usage:

val registry = RateLimiterRegistry.create()

val apiLimiter = registry.getOrCreate("api") {
permitsPerSecond = 100.0
burstCapacity = 200
}

Types

Link copied to clipboard
object Companion

Factory for RateLimiterRegistry.

Functions

Link copied to clipboard
suspend fun get(name: String): RateLimiter?

Gets an existing rate limiter by name.

Link copied to clipboard

Gets statistics for all rate limiters.

Link copied to clipboard
suspend fun getNames(): Set<String>

Gets all rate limiter names in the registry.

Link copied to clipboard
suspend fun getOrCreate(name: String, configure: RateLimiterConfigBuilder.() -> Unit? = null): RateLimiter

Gets an existing rate limiter or creates a new one.

Link copied to clipboard
suspend fun remove(name: String): RateLimiter?

Removes a rate limiter from the registry.

Link copied to clipboard
suspend fun resetAll()

Resets all rate limiters in the registry.