Package-level declarations

Types

Link copied to clipboard
class CircuitBreaker(val config: CircuitBreakerConfig = defaultCircuitBreakerConfig()) : FlowEventListenerImpl<CircuitBreakerEvent>

The Circuit Breaker is a reactive resilience mechanism that can be used to protect a system component from overloading or failing. By monitoring the health of the system, the circuit breaker can short-circuit execution requests when it detects that the system component is not behaving as expected. After a configurable timeout, the circuit breaker allows a limited number of test requests to pass through to see if the system has recovered. Depending on the test results, the circuit breaker can resume normal operation or continue to short-circuit requests. A circuit breaker is initialized with a configuration that, through pre-configured policies, define its behaviour. The circuit breaker implements the following state machine: