CircuitBreakerConfig

data class CircuitBreakerConfig(val failureThreshold: Int = 5, val recoveryTimeoutMs: Long = 60000, val successThreshold: Int = 2)

Configuration for circuit breaker behavior.

Circuit breakers help prevent cascading failures by temporarily stopping execution of tools that are consistently failing. This reduces load on failing systems and provides faster failure responses.

States:

  • CLOSED: Normal operation, requests pass through

  • OPEN: Fast-failing, requests are rejected immediately

  • HALF_OPEN: Testing recovery, limited requests pass through

Parameters

failureThreshold

Number of failures before opening the circuit (default: 5)

recoveryTimeoutMs

Time in milliseconds before testing recovery (default: 60000ms)

successThreshold

Number of successes needed to close the circuit (default: 2)

See also

Constructors

Link copied to clipboard
constructor(failureThreshold: Int = 5, recoveryTimeoutMs: Long = 60000, successThreshold: Int = 2)

Properties

Link copied to clipboard
Link copied to clipboard
val recoveryTimeoutMs: Long = 60000
Link copied to clipboard