Liking cljdoc? Tell your friends :D

d-core.core.circuit-breaker.protocol


CircuitBreakerProtocolcljprotocol

Protocol for circuit breakers guarding operations against cascading failures.

Expected states: :closed - Normal operation; calls proceed normally. :open - Failure threshold breached; calls fail-fast. :half-open - Canary probing / recovery mode (:soft); a limited number of test calls proceed.

Protocol for circuit breakers guarding operations against cascading failures.

Expected states:
  :closed    - Normal operation; calls proceed normally.
  :open      - Failure threshold breached; calls fail-fast.
  :half-open - Canary probing / recovery mode (:soft); a limited number of test calls proceed.

protect!clj

(protect! this f)
(protect! this f opts)

Executes (f) protected by the circuit breaker. Opts: :fallback - (fn [ex]) fallback function called when breaker is :open or (f) fails :timeout-ms - optional execution timeout in milliseconds Throws ex-info with {:type :circuit-breaker/open} when the circuit breaker is :open and no :fallback is provided.

Executes `(f)` protected by the circuit breaker.
Opts:
  :fallback   - (fn [ex]) fallback function called when breaker is :open or (f) fails
  :timeout-ms - optional execution timeout in milliseconds
Throws `ex-info` with `{:type :circuit-breaker/open}` when the circuit breaker is :open
and no :fallback is provided.

reset!clj

(reset! this)

Manually forces the circuit breaker back to :closed state.

Manually forces the circuit breaker back to `:closed` state.

stateclj

(state this)

Returns current circuit breaker state keyword: :closed, :open, or :half-open.

Returns current circuit breaker state keyword: `:closed`, `:open`, or `:half-open`.

trip!clj

(trip! this)

Manually forces the circuit breaker into :open state.

Manually forces the circuit breaker into `:open` state.
raw docstring

closed?clj

(closed? cb)

Returns true if the circuit breaker is currently :closed.

Returns true if the circuit breaker is currently :closed.
raw docstring

half-open?clj

(half-open? cb)

Returns true if the circuit breaker is currently :half-open (probing / soft).

Returns true if the circuit breaker is currently :half-open (probing / soft).
raw docstring

open?clj

(open? cb)

Returns true if the circuit breaker is currently :open.

Returns true if the circuit breaker is currently :open.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close