RateLimiterRegistry

Registry of named DefaultRateLimiter instances so multiple com.santimattius.resilient.ResilientPolicy configurations can share the same rate-limiter quota (e.g. one token bucket per downstream "payments", "db").

Thread-safety: getOrCreate is not synchronized across platforms. Typical use is to build policies on a single thread at startup; do not call getOrCreate concurrently for the same registry without external synchronization.

The first successful getOrCreate for a given name wins; subsequent calls return the same instance and ignore configuration differences (document your convention: one name, one config).

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun getOrCreate(name: String, configure: RateLimiterConfig.() -> Unit, onRateLimited: suspend (Duration) -> Unit? = null): DefaultRateLimiter

Returns an existing DefaultRateLimiter for name, or creates one with configure.