Reference to Akka scheduler
Maximum number of failures before opening the circuit
scala.concurrent.duration.FiniteDuration of time after which to consider a call a failure
scala.concurrent.duration.FiniteDuration of time after which to attempt to close the circuit
scala.concurrent.ExecutionContext used for execution of state transition listeners
Java API for #withCircuitBreaker
Java API for #withCircuitBreaker
return type from call
Call needing protected
scala.concurrent.Future containing the call result
Java API for #withSyncCircuitBreaker
Java API for #withSyncCircuitBreaker
return type from call
Call needing protected
The result of the call
JavaAPI for onClose
JavaAPI for onClose
Handler to be invoked on state change
CircuitBreaker for fluent usage
Adds a callback to execute when circuit breaker state closes
Adds a callback to execute when circuit breaker state closes
The callback is run in the scala.concurrent.ExecutionContext supplied in the constructor.
Handler to be invoked on state change
CircuitBreaker for fluent usage
JavaAPI for onHalfOpen
JavaAPI for onHalfOpen
Handler to be invoked on state change
CircuitBreaker for fluent usage
Adds a callback to execute when circuit breaker transitions to half-open
Adds a callback to execute when circuit breaker transitions to half-open
The callback is run in the scala.concurrent.ExecutionContext supplied in the constructor.
Handler to be invoked on state change
CircuitBreaker for fluent usage
Java API for onOpen
Java API for onOpen
Handler to be invoked on state change
CircuitBreaker for fluent usage
Adds a callback to execute when circuit breaker opens
Adds a callback to execute when circuit breaker opens
The callback is run in the scala.concurrent.ExecutionContext supplied in the constructor.
Handler to be invoked on state change
CircuitBreaker for fluent usage
Wraps invocations of asynchronous calls that need to be protected
Wraps invocations of asynchronous calls that need to be protected
return type from call
Call needing protected
scala.concurrent.Future containing the call result
Wraps invocations of synchronous calls that need to be protected
Wraps invocations of synchronous calls that need to be protected
Calls are run in caller's thread
return type from call
Call needing protected
The result of the call
Provides circuit breaker functionality to provide stability when working with "dangerous" operations, e.g. calls to remote systems
Transitions through three states: - In *Closed* state, calls pass through until the
maxFailures
count is reached. This causes the circuit breaker to open. Both exceptions and calls exceedingcallTimeout
are considered failures. - In *Open* state, calls fail-fast with an exception. AfterresetTimeout
, circuit breaker transitions to half-open state. - In *Half-Open* state, the first call will be allowed through, if it succeeds the circuit breaker will reset to closed state. If it fails, the circuit breaker will re-open to open state. All calls beyond the first that execute while the first is running will fail-fast with an exception.