CircuitState enum

The state of a circuit breaker.

A circuit breaker progresses through these states:

  • closed - Normal operation, allowing requests through
  • open - Circuit is open, failing fast without attempting requests
  • halfOpen - Testing if service has recovered, allowing limited requests
Inheritance
Available extensions

Values

closed → const CircuitState

Circuit is closed - normal operation allowing all requests through.

In this state, the circuit breaker monitors failures but allows all requests to proceed normally.

open → const CircuitState

Circuit is open - failing fast without attempting requests.

In this state, the circuit breaker immediately rejects requests without attempting to execute them, preserving system resources.

halfOpen → const CircuitState

Circuit is half-open - testing if service has recovered.

In this state, the circuit breaker allows a limited number of requests to test if the service has recovered. If successful, it transitions to closed; if failed, it transitions back to open.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<CircuitState>
A constant List of the values in this enum, in order of their declaration.