public class CircuitBreaker extends Object
This class uses a state machine with three states: Closed, HalfOpen, and Open.
Modifier and Type | Class and Description |
---|---|
static class |
CircuitBreaker.Setting
Settings class for the circuit breaker that defines its behavior.
|
static class |
CircuitBreaker.Token
A token returned by the circuit breaker to indicate whether a request is allowed.
|
Constructor and Description |
---|
CircuitBreaker()
Default constructor that uses the default settings.
|
CircuitBreaker(CircuitBreaker.Setting setting)
Constructor that allows specifying custom settings.
|
Modifier and Type | Method and Description |
---|---|
CircuitBreaker.Token |
allow()
Attempt to allow a request based on the current state of the circuit breaker.
|
public CircuitBreaker()
public CircuitBreaker(CircuitBreaker.Setting setting)
setting
- The settings to use for the circuit breaker.public CircuitBreaker.Token allow()
Copyright © 2025. All rights reserved.