vapor-chamber API reference - v1.3.0
    Preparing search index...

    Type Alias CircuitBreakerOptions

    type CircuitBreakerOptions = {
        threshold?: number;
        resetTimeout?: number;
        actions?: string[];
        onOpen?: (action: string, failCount: number) => void;
        onClose?: (action: string) => void;
    }
    Index

    Properties

    threshold?: number

    Number of consecutive failures before the circuit opens. Default: 5.

    resetTimeout?: number

    Time in ms the circuit stays open before trying half-open. Default: 30_000.

    actions?: string[]

    Which actions to protect. Glob patterns. Default: all.

    onOpen?: (action: string, failCount: number) => void

    Called when circuit opens.

    onClose?: (action: string) => void

    Called when circuit resets (half-open succeeds).