Open

final class Open extends State

State of the CircuitBreaker in which the circuit breaker rejects all tasks with an ExecutionRejectedException.

State of the CircuitBreaker in which the circuit breaker rejects all tasks with an ExecutionRejectedException.

Contract:

  • all tasks fail fast with ExecutionRejectedException
  • after the configured resetTimeout, the circuit breaker enters a HalfOpen state, allowing one task to go through for testing the connection
Value Params
awaitClose

is a Deferred (pure promise) that will get completed when the CircuitBreaker will switch to the Closed state again; this reference is None in case the F[_] used does not implement cats.effect.Async, because only with Async data types we can wait for completion.

resetTimeout

is the current resetTimeout that is applied to this Open state, to be multiplied by the exponential backoff factor for the next transition from HalfOpen to Open, in case the reset attempt fails

startedAt

is the timestamp in milliseconds since the epoch when the transition to Open happened

Companion
object
class State
class Object
trait Matchable
class Any

Value members

Concrete methods

override def equals(other: Any): Boolean
Definition Classes
Any
override def hashCode(): Int
Definition Classes
Any

Concrete fields

The timestamp in milliseconds since the epoch, specifying when the Open state is to transition to HalfOpen.

The timestamp in milliseconds since the epoch, specifying when the Open state is to transition to HalfOpen.

It is calculated as: startedAt + resetTimeout.toMillis

val resetTimeout: FiniteDuration