Circuit breaker protecting calls to an unreliable dependency.
const result = await breaker.execute(() => externalApi.fetchRates()); Copy
const result = await breaker.execute(() => externalApi.fetchRates());
0.1.0
Readonly
The current circuit state.
Executes a call through the breaker.
The call's result type
The protected call, handed the cancellation signal for this attempt
The call result
Fails fast when the circuit is open; otherwise propagates the call's own error
Circuit breaker protecting calls to an unreliable dependency.
Example
Since
0.1.0