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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceDefines if a request is considered a success or a failure.static enumRepresents all the states a circuit breaker can be in, possibly. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if requests are allowed to go through and be tracked.voidThe tracked request is marked failure.voidThe tracked request is marked succeeded.voidreset()Resets this circuit breaker to its initial state.state()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.
-