Package akka.pattern
Class CircuitBreaker$
- java.lang.Object
-
- akka.pattern.CircuitBreaker$
-
public class CircuitBreaker$ extends java.lang.Object
Companion object providing factory methods for Circuit Breaker which runs callbacks in caller's thread
-
-
Field Summary
Fields Modifier and Type Field Description static CircuitBreaker$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description CircuitBreaker$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CircuitBreaker
apply(Scheduler scheduler, int maxFailures, scala.concurrent.duration.FiniteDuration callTimeout, scala.concurrent.duration.FiniteDuration resetTimeout)
Create a new CircuitBreaker.CircuitBreaker
apply(java.lang.String id, ExtendedActorSystem system)
Create or find a CircuitBreaker in registry.protected <T> scala.Function1<scala.util.Try<T>,java.lang.Object>
convertJavaFailureFnToScala(java.util.function.BiFunction<java.util.Optional<T>,java.util.Optional<java.lang.Throwable>,java.lang.Boolean> javaFn)
CircuitBreaker
create(Scheduler scheduler, int maxFailures, java.time.Duration callTimeout, java.time.Duration resetTimeout)
Java API: Create a new CircuitBreaker.CircuitBreaker
lookup(java.lang.String id, ExtendedActorSystem system)
Java API: Lookup a CircuitBreaker in registry.
-
-
-
Field Detail
-
MODULE$
public static final CircuitBreaker$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
apply
public CircuitBreaker apply(Scheduler scheduler, int maxFailures, scala.concurrent.duration.FiniteDuration callTimeout, scala.concurrent.duration.FiniteDuration resetTimeout)
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.
- Parameters:
scheduler
- Reference to Akka schedulermaxFailures
- Maximum number of failures before opening the circuitcallTimeout
-FiniteDuration
of time after which to consider a call a failureresetTimeout
-FiniteDuration
of time after which to attempt to close the circuit
-
apply
public CircuitBreaker apply(java.lang.String id, ExtendedActorSystem system)
Create or find a CircuitBreaker in registry.- Parameters:
id
- Circuit Breaker identifiersystem
-ExtendedActorSystem
that is storing thisCircuitBreaker
-
create
public CircuitBreaker create(Scheduler scheduler, int maxFailures, java.time.Duration callTimeout, java.time.Duration resetTimeout)
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.
- Parameters:
scheduler
- Reference to Akka schedulermaxFailures
- Maximum number of failures before opening the circuitcallTimeout
-Duration
of time after which to consider a call a failureresetTimeout
-Duration
of time after which to attempt to close the circuit
-
lookup
public CircuitBreaker lookup(java.lang.String id, ExtendedActorSystem system)
Java API: Lookup a CircuitBreaker in registry.- Parameters:
id
- Circuit Breaker identifiersystem
-ExtendedActorSystem
that is storing thisCircuitBreaker
-
convertJavaFailureFnToScala
protected <T> scala.Function1<scala.util.Try<T>,java.lang.Object> convertJavaFailureFnToScala(java.util.function.BiFunction<java.util.Optional<T>,java.util.Optional<java.lang.Throwable>,java.lang.Boolean> javaFn)
-
-