method ICircuitBreaker.execute
ICircuitBreaker.execute<T>(fn: ResilientCall<T>): Promise<T>

Executes a call through the breaker.

Type Parameters

The call's result type

Parameters

The protected call, handed the cancellation signal for this attempt

Return Type

Promise<T>

The call result

Throws

Error

Fails fast when the circuit is open; otherwise propagates the call's own error

Usage

import { type ICircuitBreaker } from "common/src/index.ts";