TimeLimiterRegistry

Registry for managing multiple named time limiters.

Example usage:

val registry = TimeLimiterRegistry.create()

val fastLimiter = registry.getOrCreate("fast-operations") {
timeout = 1.seconds
}

val slowLimiter = registry.getOrCreate("slow-operations") {
timeout = 30.seconds
}

Types

Link copied to clipboard
object Companion

Factory for TimeLimiterRegistry.

Functions

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

Gets an existing time limiter by name.

Link copied to clipboard

Gets statistics for all time limiters.

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

Gets all time limiter names in the registry.

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

Gets an existing time limiter or creates a new one.

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

Removes a time limiter from the registry.

Link copied to clipboard
suspend fun resetAllStatistics()

Resets statistics for all time limiters in the registry.