public class CircuitBreakerProxy$
extends java.lang.Object
CircuitBreaker
Modifier and Type | Field and Description |
---|---|
static CircuitBreakerProxy$ |
MODULE$
Static reference to the singleton instance of this Scala object.
|
Constructor and Description |
---|
CircuitBreakerProxy$() |
Modifier and Type | Method and Description |
---|---|
Props |
props(ActorRef target,
int maxFailures,
Timeout callTimeout,
Timeout resetTimeout,
scala.Option<ActorRef> circuitEventListener,
scala.Function1<java.lang.Object,java.lang.Object> failureDetector,
scala.Function1<CircuitBreakerProxy.CircuitOpenFailure,java.lang.Object> failureMap)
Creates an circuit breaker actor proxying a target actor intended for request-reply interactions.
|
public static final CircuitBreakerProxy$ MODULE$
public Props props(ActorRef target, int maxFailures, Timeout callTimeout, Timeout resetTimeout, scala.Option<ActorRef> circuitEventListener, scala.Function1<java.lang.Object,java.lang.Object> failureDetector, scala.Function1<CircuitBreakerProxy.CircuitOpenFailure,java.lang.Object> failureMap)
CircuitBreakerProxy.TellOnly
or a
CircuitBreakerProxy.Passthrough
the difference between the two being that
a message wrapped into a CircuitBreakerProxy.Passthrough
is going to be
forwarded even when the circuit is open (e.g. if you need to terminate the target and proxy actors sending
a PoisonPill
message)
The circuit breaker implements the same state machine documented in CircuitBreaker
target
- the actor to proxymaxFailures
- maximum number of failures before opening the circuitcallTimeout
- timeout before considering the ongoing call a failureresetTimeout
- time after which the channel will be closed after entering the open statecircuitEventListener
- an actor that will receive a series of messages of type
CircuitBreakerProxy.CircuitBreakerEvent
failureDetector
- function to detect if the a message received from the target actor as
response from a request represent a failurefailureMap
- function to map a failure into a response message. The failing response message is wrapped
into a CircuitBreakerProxy.CircuitOpenFailure
object