Attributes
- Companion:
- trait
- Source:
- CircuitBreaker.scala
- Graph
- Supertypes
- Self type
- CircuitBreaker.type
Members list
Type members
Classlikes
Attributes
- Source:
- CircuitBreaker.scala
- Graph
- Supertypes
- Self type
- Builder[F]
The initial State of the CircuitBreaker. While in this state the circuit breaker allows tasks to be executed.
The initial State of the CircuitBreaker. While in this state the circuit breaker allows tasks to be executed.
Contract:
- Exceptions increment the
failures
counter - Successes reset the failure count to zero
- When the
failures
counter reaches themaxFailures
count, the breaker is tripped into theOpen
state
Attributes
- failures
is the current failures count
- Source:
- CircuitBreaker.scala
- Graph
- Supertypes
State of the CircuitBreaker in which the circuit breaker has already allowed a task to go through, as a reset attempt, in order to test the connection.
State of the CircuitBreaker in which the circuit breaker has already allowed a task to go through, as a reset attempt, in order to test the connection.
Contract:
- The first task when
Open
has expired is allowed through without failing fast, just before the circuit breaker is evolved into theHalfOpen
state - All tasks attempted in
HalfOpen
fail-fast with an exception just as in Open state - If that task attempt succeeds, the breaker is reset back to
the
Closed
state, with theresetTimeout
and thefailures
count also reset to initial values - If the first call fails, the breaker is tripped again into
the
Open
state (theresetTimeout
is passed to thebackoff
function)
Attributes
- Source:
- CircuitBreaker.scala
- Graph
- Supertypes
- Self type
- HalfOpen.type
State of the CircuitBreaker in which the circuit breaker rejects all tasks with a RejectedExecution.
State of the CircuitBreaker in which the circuit breaker rejects all tasks with a RejectedExecution.
Contract:
- all tasks fail fast with
RejectedExecution
- after the configured
resetTimeout
, the circuit breaker enters a HalfOpen state, allowing one task to go through for testing the connection
Attributes
- resetTimeout
is the current
resetTimeout
that is applied to thisOpen
state, to be passed to thebackoff
function for the next transition fromHalfOpen
toOpen
, in case the reset attempt fails- startedAt
is the timestamp in milliseconds since the epoch when the transition to
Open
happened- Source:
- CircuitBreaker.scala
- Graph
- Supertypes
Attributes
- Source:
- CircuitBreaker.scala
- Graph
- Supertypes
- Known subtypes
Exception thrown whenever an execution attempt was rejected.
Exception thrown whenever an execution attempt was rejected.
Attributes
- Source:
- CircuitBreaker.scala
- Graph
- Supertypes
- trait Producttrait Equalsclass RuntimeExceptionclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass Any
An enumeration that models the internal state of CircuitBreaker,
kept in an AtomicReference
for synchronization.
An enumeration that models the internal state of CircuitBreaker,
kept in an AtomicReference
for synchronization.
The initial state when initializing a CircuitBreaker is Closed. The available states:
Attributes
- Source:
- CircuitBreaker.scala
- Graph
- Supertypes
- Known subtypes
Types
Type-alias to document timestamps specified in milliseconds, as returned by Clock.realTime.
Type-alias to document timestamps specified in milliseconds, as returned by Clock.realTime.
Attributes
- Source:
- CircuitBreaker.scala
Value members
Concrete methods
Attributes
- Source:
- CircuitBreaker.scala
Builder for a CircuitBreaker reference.
Builder for a CircuitBreaker reference.
Effect returned by this operation produces a new CircuitBreaker each time it is evaluated. To share a state between multiple consumers, pass CircuitBreaker as a parameter
Attributes
- backoff
is a function from FiniteDuration to FiniteDuration used to determine the
resetTimeout
when in theHalfOpen
state, in case the attempt toClose
fails. Backoff provides some default implementations.- maxFailures
is the maximum count for failures before opening the circuit breaker
- maxResetTimeout
is the maximum timeout the circuit breaker is allowed to use when applying the
backoff
- resetTimeout
is the timeout to wait in the
Open
state before attempting a close of the circuit breaker (but without the backoff function applied)- Source:
- CircuitBreaker.scala
Builder for a CircuitBreaker reference.
Builder for a CircuitBreaker reference.
Effect returned by this operation produces a new CircuitBreaker each time it is evaluated. To share a state between multiple consumers, pass CircuitBreaker as a parameter
This method returns a circuit breaker inside of a different effect from its own. For a simpler version, see CircuitBreaker.of.
Attributes
- backoff
is a function from FiniteDuration to FiniteDuration used to determine the
resetTimeout
when in theHalfOpen
state, in case the attempt toClose
fails. Backoff provides some default implementations.- maxFailures
is the maximum count for failures before opening the circuit breaker
- maxResetTimeout
is the maximum timeout the circuit breaker is allowed to use when applying the
backoff
- onClosed
is for signaling a transition to
Closed
- onHalfOpen
is for signaling a transition to
HalfOpen
- onOpen
is for signaling a transition to
Open
- onRejected
is for signaling rejected tasks
- resetTimeout
is the timeout to wait in the
Open
state before attempting a close of the circuit breaker (but without the backoff function applied)- Source:
- CircuitBreaker.scala
Creates a No-Operation circuit breaker which is always closed and passes through the effect.
Creates a No-Operation circuit breaker which is always closed and passes through the effect.
Attributes
- Source:
- CircuitBreaker.scala
Builder for a CircuitBreaker reference.
Builder for a CircuitBreaker reference.
Effect returned by this operation produces a new CircuitBreaker each time it is evaluated. To share a state between multiple consumers, pass CircuitBreaker as a parameter
Attributes
- backoff
is a function from FiniteDuration to FiniteDuration used to determine the
resetTimeout
when in theHalfOpen
state, in case the attempt toClose
fails. Backoff provides some default implementations.- maxFailures
is the maximum count for failures before opening the circuit breaker
- maxResetTimeout
is the maximum timeout the circuit breaker is allowed to use when applying the
backoff
result.- resetTimeout
is the timeout to wait in the
Open
state before attempting a close of the circuit breaker (but without the backoff function applied)- Source:
- CircuitBreaker.scala
Builder for a CircuitBreaker reference.
Builder for a CircuitBreaker reference.
Effect returned by this operation produces a new CircuitBreaker each time it is evaluated. To share a state between multiple consumers, pass CircuitBreaker as a parameter
Attributes
- backoff
is a function from FiniteDuration to FiniteDuration used to determine the
resetTimeout
when in theHalfOpen
state, in case the attempt toClose
fails. Backoff provides some default implementations.- maxFailures
is the maximum count for failures before opening the circuit breaker
- maxResetTimeout
is the maximum timeout the circuit breaker is allowed to use when applying the
backoff
- onClosed
is for signaling a transition to
Closed
- onHalfOpen
is for signaling a transition to
HalfOpen
- onOpen
is for signaling a transition to
Open
- onRejected
is for signaling rejected tasks
- resetTimeout
is the timeout to wait in the
Open
state before attempting a close of the circuit breaker (but without the backoff function applied)- Source:
- CircuitBreaker.scala
For Custom Ref Implementations Ideally this will be in some valid state for the state machine and that maxFailures/resetTimeout/backoff/maxResetTimeout will all be consistent across users or else you may wait based on incorrect information.
For Custom Ref Implementations Ideally this will be in some valid state for the state machine and that maxFailures/resetTimeout/backoff/maxResetTimeout will all be consistent across users or else you may wait based on incorrect information.
Attributes
- Source:
- CircuitBreaker.scala