Skip to content

PostgresCircuitBreakerStore

Defined in: src/adapters/postgres.ts:208

Circuit breaker state store backed by PostgreSQL.

new PostgresCircuitBreakerStore(client, table): PostgresCircuitBreakerStore

Defined in: src/adapters/postgres.ts:209

PostgresClient

string

PostgresCircuitBreakerStore

getState(key): Promise<CircuitBreakerSnapshot>

Defined in: src/adapters/postgres.ts:214

Read the current snapshot for a circuit key.

string

Promise<CircuitBreakerSnapshot>

CircuitBreakerStore.getState


recordFailure(key): Promise<CircuitBreakerSnapshot>

Defined in: src/adapters/postgres.ts:237

Record a failed request and return the updated snapshot.

string

Promise<CircuitBreakerSnapshot>

CircuitBreakerStore.recordFailure


recordSuccess(key): Promise<CircuitBreakerSnapshot>

Defined in: src/adapters/postgres.ts:224

Record a successful request and return the updated snapshot.

string

Promise<CircuitBreakerSnapshot>

CircuitBreakerStore.recordSuccess


reset(key): Promise<void>

Defined in: src/adapters/postgres.ts:281

Fully reset a circuit, removing all state.

string

Promise<void>

CircuitBreakerStore.reset


transition(key, to): Promise<CircuitBreakerSnapshot>

Defined in: src/adapters/postgres.ts:251

Transition the circuit to a new state and return the updated snapshot.

string

CircuitState

Promise<CircuitBreakerSnapshot>

CircuitBreakerStore.transition