Called by a circuit breaker to find out if an operation should be allowed to proceed.
Called by a circuit breaker to find out if an operation should be allowed to proceed.
a pair of a boolean flag indicating if the operation should succeed, and the next circuit breaker state
Called by a circuit breaker when an operation fails
Called by a circuit breaker when an operation fails
the next circuit breaker state
Called by a circuit breaker when an operation succeeds
Called by a circuit breaker when an operation succeeds
the next circuit breaker state
A family of immutable circuit breaker states with transition methods that return the next state.
This class is meant to abstract the logic of circuit-breaker state transitions away from the details of a circuit breaker's API and state management, which might differ depending on the application. E.g., we might build an event-driven circuit breaker with state managed by a simple variable for use in an Actor, or we might want a thread-safe circuit breaker for use with a process that returns Futures.