InMemoryCircuitBreakerStore
Defined in: src/policies/resilience/circuit-breaker.ts:65
Three-state circuit breaker (closed/open/half-open) with pluggable state storage (priority 30).
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InMemoryCircuitBreakerStore():
InMemoryCircuitBreakerStore
Returns
Section titled “Returns”InMemoryCircuitBreakerStore
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Defined in: src/policies/resilience/circuit-breaker.ts:113
Remove all circuits (for testing)
Returns
Section titled “Returns”void
getState()
Section titled “getState()”getState(
key):Promise<CircuitBreakerSnapshot>
Defined in: src/policies/resilience/circuit-breaker.ts:77
Read the current snapshot for a circuit key.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<CircuitBreakerSnapshot>
Implementation of
Section titled “Implementation of”recordFailure()
Section titled “recordFailure()”recordFailure(
key):Promise<CircuitBreakerSnapshot>
Defined in: src/policies/resilience/circuit-breaker.ts:87
Record a failed request and return the updated snapshot.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<CircuitBreakerSnapshot>
Implementation of
Section titled “Implementation of”CircuitBreakerStore.recordFailure
recordSuccess()
Section titled “recordSuccess()”recordSuccess(
key):Promise<CircuitBreakerSnapshot>
Defined in: src/policies/resilience/circuit-breaker.ts:81
Record a successful request and return the updated snapshot.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<CircuitBreakerSnapshot>
Implementation of
Section titled “Implementation of”CircuitBreakerStore.recordSuccess
reset()
Section titled “reset()”reset(
key):Promise<void>
Defined in: src/policies/resilience/circuit-breaker.ts:108
Fully reset a circuit, removing all state.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”transition()
Section titled “transition()”transition(
key,to):Promise<CircuitBreakerSnapshot>
Defined in: src/policies/resilience/circuit-breaker.ts:94
Transition the circuit to a new state and return the updated snapshot.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<CircuitBreakerSnapshot>