Skip to content

API Reference


API Reference / CircuitBreakerOptions

Interface: CircuitBreakerOptions

Defined in: src/client/CircuitBreaker.ts:6

Properties

failureThreshold?

optional failureThreshold?: number

Defined in: src/client/CircuitBreaker.ts:8

Consecutive failures required to open the circuit. Defaults to 5.


resetTimeoutMs?

optional resetTimeoutMs?: number

Defined in: src/client/CircuitBreaker.ts:10

How long the circuit stays open before allowing a trial request. Defaults to 30s.


isFailure?

optional isFailure?: (error) => boolean

Defined in: src/client/CircuitBreaker.ts:12

Which errors count as failures. Defaults to treating every rejection as one.

Parameters

error

unknown

Returns

boolean


logger?

optional logger?: Logger

Defined in: src/client/CircuitBreaker.ts:13

Community project — not affiliated with Dhan. MIT License.