firefly-limiter - v1.0.1
    Preparing search index...

    Interface ConsecutiveBreakerOptions

    Trips on a run of failures with nothing in between.

    interface ConsecutiveBreakerOptions {
        clock?: Clock;
        isFailure?: (error: unknown) => boolean;
        onEvent?: EventSink;
        probes?: number;
        resetAfter: number;
        threshold: number;
        window?: undefined;
    }

    Hierarchy

    • CircuitBreakerBase
      • ConsecutiveBreakerOptions
    Index
    clock?: Clock

    Defaults to the system clock.

    isFailure?: (error: unknown) => boolean

    Whether an error counts against the breaker. An error it declines is not recorded at all: it neither opens nor closes the circuit, and passes through untouched. Defaults to counting every failure.

    onEvent?: EventSink

    Receives circuit-open, circuit-half-open and circuit-close.

    probes?: number

    Calls let through while the circuit is half-open, and successes needed to close it. Defaults to 1.

    More than one probe closes a recovered dependency faster; every probe is also a call to something that was failing a moment ago.

    resetAfter: number

    How long the circuit stays open before one trial call is allowed through.

    threshold: number

    Consecutive failures that open the circuit.

    window?: undefined