Aster TypeScript 0.3.893
    Preparing search index...

    Class CircuitBreakerInterceptor

    Circuit breaker for failing endpoints.

    Implements

    Index

    Accessors

    • get currentState(): State

      Current circuit state.

      Returns State

    • get halfOpenInFlight(): number

      Half-open probe slots currently taken.

      Returns number

    Constructors

    Methods

    • Admit a call or throw UNAVAILABLE. An open circuit turns half-open once resetTimeoutMs has passed; a half-open circuit admits up to halfOpenMaxCalls probes.

      Returns void

    • Record a successful call: closes the circuit.

      Returns void

    • Record a failed call. Only UNAVAILABLE / INTERNAL / UNKNOWN count; any other code gives back a half-open probe slot. Without an error (legacy callers) the failure counts.

      Parameters

      Returns void

    • Give back a half-open probe slot taken by beforeCall for a call whose outcome says nothing about the peer (cancelled, refused by another breaker). Without this the breaker stays half-open with no free slot and refuses every later call.

      Returns void