object CircuitBreaker
Companion object providing factory methods for Circuit Breaker which runs callbacks in caller's thread
- Source
- CircuitBreaker.scala
- Alphabetic
- By Inheritance
- CircuitBreaker
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
apply(scheduler: Scheduler, maxFailures: Int, callTimeout: FiniteDuration, resetTimeout: FiniteDuration): CircuitBreaker
Create a new CircuitBreaker.
Create a new CircuitBreaker.
Callbacks run in caller's thread when using withSyncCircuitBreaker, and in same ExecutionContext as the passed in Future when using withCircuitBreaker. To use another ExecutionContext for the callbacks you can specify the executor in the constructor.
- scheduler
Reference to Akka scheduler
- maxFailures
Maximum number of failures before opening the circuit
- callTimeout
scala.concurrent.duration.FiniteDuration of time after which to consider a call a failure
- resetTimeout
scala.concurrent.duration.FiniteDuration of time after which to attempt to close the circuit
-
def
create(scheduler: Scheduler, maxFailures: Int, callTimeout: FiniteDuration, resetTimeout: FiniteDuration): CircuitBreaker
Java API: Create a new CircuitBreaker.
Java API: Create a new CircuitBreaker.
Callbacks run in caller's thread when using withSyncCircuitBreaker, and in same ExecutionContext as the passed in Future when using withCircuitBreaker. To use another ExecutionContext for the callbacks you can specify the executor in the constructor.
- scheduler
Reference to Akka scheduler
- maxFailures
Maximum number of failures before opening the circuit
- callTimeout
scala.concurrent.duration.FiniteDuration of time after which to consider a call a failure
- resetTimeout
scala.concurrent.duration.FiniteDuration of time after which to attempt to close the circuit