interface ICircuitBreaker
Since 0.1.0

Circuit breaker protecting calls to an unreliable dependency.

Examples

Example 1

const result = await breaker.execute(() => externalApi.fetchRates());

Properties

The current circuit state.

Methods

execute<T>(fn: ResilientCall<T>): Promise<T>

Executes a call through the breaker.

Usage

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