Interface CircuitBreaker
- All Known Implementing Classes:
NoopCircuitBreaker
public interface CircuitBreaker
The
CircuitBreaker interface defines the external integration points between an
implementation and its calling BaseEndpoint.
See the individual implementation for details on how they work. Note that they are all
configured through the CircuitBreakerConfig that is configured on the environment on
a per service basis and applied on a per endpoint basis.
- Since:
- 2.0.0
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceCircuitBreaker.CompletionCallbackDefines if a request is considered a success or a failure.static classCircuitBreaker.StateRepresents all the states a circuit breaker can be in, possibly. -
Method Summary
Modifier and Type Method Description booleanallowsRequest()Returns true if requests are allowed to go through and be tracked.voidmarkFailure()The tracked request is marked failure.voidmarkSuccess()The tracked request is marked succeeded.voidreset()Resets this circuit breaker to its initial state.CircuitBreaker.Statestate()Returns the current state of the circuit breaker.voidtrack()Marks that a circuit breaker should start tracking.
-
Method Details
-
track
void track()Marks that a circuit breaker should start tracking. -
markSuccess
void markSuccess()The tracked request is marked succeeded. -
markFailure
void markFailure()The tracked request is marked failure. -
reset
void reset()Resets this circuit breaker to its initial state. -
allowsRequest
boolean allowsRequest()Returns true if requests are allowed to go through and be tracked. -
state
CircuitBreaker.State state()Returns the current state of the circuit breaker.
-