Liking cljdoc? Tell your friends :D

resilience4clj.circuit-breaker

Functions to create and execute circuit breakers.

Functions to create and execute circuit breakers.
raw docstring

add-configuration!clj

(add-configuration! name config)
(add-configuration! registry name config)

Adds config to the registry under the name.

Uses default-registry if registry is not provided.

Adds `config` to the `registry` under the `name`.

Uses [[default-registry]] if `registry` is not provided.
sourceraw docstring

all-circuit-breakersclj

(all-circuit-breakers)
(all-circuit-breakers registry)

Gets all the circuit breakers in registry.

Uses default-registry if registry is not provided.

Gets all the circuit breakers in `registry`.

Uses [[default-registry]] if `registry` is not provided.
sourceraw docstring

circuit-breakerclj

(circuit-breaker name)
(circuit-breaker name config)

Creates a circuit breaker with name and config.

Creates a circuit breaker with `name` and `config`.
sourceraw docstring

circuit-breaker!clj

(circuit-breaker! name)
(circuit-breaker! registry name)
(circuit-breaker! registry name config)

Creates or fetches a circuit breaker with name and config and stores it in registry.

The config value can be either a config map or the name of a config map stored in the registry. If the circuit breaker already exists in the registry, the config value is ignored.

Uses default-registry if registry is not provided.

Creates or fetches a circuit breaker with `name` and `config` and stores it
in `registry`.

The config value can be either a config map or the name of a config map stored
in the registry. If the circuit breaker already exists in the registry, the
config value is ignored.

Uses [[default-registry]] if `registry` is not provided.
sourceraw docstring

close!clj

(close! circuit-breaker)

Transitions circuit-breaker to the :closed state.

Transitions `circuit-breaker` to the `:closed` state.
sourceraw docstring

default-registryclj

The default registry for storing circuit breakers and configurations.

The default registry for storing circuit breakers and configurations.
sourceraw docstring

disable!clj

(disable! circuit-breaker)

Transitions circuit-breaker to the :disabled state.

In the :disabled state, the circuit breaker will not automatically transition to other states, collect metrics, or send events. All calls will be allowed to pass.

You must manually transition out of the :disabled state.

Transitions `circuit-breaker` to the `:disabled` state.

In the `:disabled` state, the circuit breaker will not automatically
transition to other states, collect metrics, or send events. All calls will be
allowed to pass.

You must manually transition out of the `:disabled` state.
sourceraw docstring

emit-events!clj

(emit-events! circuit-breaker
              out-chan
              &
              {:keys [only exclude] :or {exclude []}})

Offers events circuit-breaker to out-chan.

The event types are identified by event-types.

This function also accepts :only and :exclude keyword params that are sequences of the event types that should be included or excluded, respectively.

Offers events `circuit-breaker` to `out-chan`.

The event types are identified by [[event-types]].

This function also accepts `:only` and `:exclude` keyword params that are
sequences of the event types that should be included or excluded,
respectively.
sourceraw docstring

emit-registry-events!clj

(emit-registry-events! out-chan)
(emit-registry-events! registry
                       out-chan
                       &
                       {:keys [only exclude] :or {exclude []}})

Offers registry events to out-chan.

The event types are identified by registry-event-types.

This function also accepts :only and :exclude keyword params that are sequences of the event types that should be included or excluded, respectively.

Uses default-registry if registry is not provided.

Offers registry events to `out-chan`.

The event types are identified by [[registry-event-types]].

This function also accepts `:only` and `:exclude` keyword params that are
sequences of the event types that should be included or excluded,
respectively.

Uses [[default-registry]] if `registry` is not provided.
sourceraw docstring

event-typesclj

source

executeclj

(execute circuit-breaker f & args)

Apply args to f within a context protected by circuit-breaker.

Apply `args` to `f` within a context protected by `circuit-breaker`.
sourceraw docstring

findclj

(find name)
(find registry name)

Finds the circuit breaker identified by name in registry.

Uses default-registry if registry is not provided.

Finds the circuit breaker identified by `name` in `registry`.

Uses [[default-registry]] if `registry` is not provided.
sourceraw docstring

force-open!clj

(force-open! circuit-breaker)

Transitions circuit-breaker to the :forced-open state.

In the :forced-open state, the circuit breaker will not automatically transition to other states, collect metrics, or send events. No call will be allowed to pass.

You must manually transition out of the :forced-open state.

Transitions `circuit-breaker` to the `:forced-open` state.

In the `:forced-open` state, the circuit breaker will not automatically
transition to other states, collect metrics, or send events. No call will be
allowed to pass.

You must manually transition out of the `:forced-open` state.
sourceraw docstring

half-open!clj

(half-open! circuit-breaker)

Transitions circuit-breaker to the :half-open state.

Transitions `circuit-breaker` to the `:half-open` state.
sourceraw docstring

metrics-only!clj

(metrics-only! circuit-breaker)

Transitions circuit-breaker to the :metrics-only state.

In the :metrics-only state, the circuit breaker will not transition to other states, but it will continue to capture metrics and publish events.

You must manually transition out of the `:metrics-only`` state.

Transitions `circuit-breaker` to the `:metrics-only` state.

In the `:metrics-only` state, the circuit breaker will not transition to
other states, but it will continue to capture metrics and publish events.

You must manually transition out of the `:metrics-only`` state.
sourceraw docstring

nameclj

(name circuit-breaker)

Gets the name of circuit-breaker.

Gets the name of `circuit-breaker`.
sourceraw docstring

open!clj

(open! circuit-breaker)

Transitions circuit-breaker to the :open state.

Transitions `circuit-breaker` to the `:open` state.
sourceraw docstring

permitting-calls?clj

(permitting-calls? circuit-breaker)

Indicates whether circuit-breaker is allowing calls to be executed.

Indicates whether `circuit-breaker` is allowing calls to be executed.
sourceraw docstring

registryclj

(registry)
(registry configs-map)

Creates a registry with default values or using a map of name/config-map pairs.

Creates a registry with default values or using a map of name/config-map pairs.
sourceraw docstring

registry-event-typesclj

The event types that can be raised by a registry.

The event types that can be raised by a registry.
sourceraw docstring

remove!clj

(remove! name)
(remove! registry name)

Removes the circuit breaker idenfitied by name from registry.

Uses default-registry if registry is not provided.

Removes the circuit breaker idenfitied by `name` from `registry`.

Uses [[default-registry]] if `registry` is not provided.
sourceraw docstring

replace!clj

(replace! name circuit-breaker)
(replace! registry name circuit-breaker)

Replaces the circuit breaker identified by name in registry with the specified circuit-breaker.

Uses default-registry if registry is not provided.

Replaces the circuit breaker identified by `name` in `registry` with the specified `circuit-breaker`.

Uses [[default-registry]] if `registry` is not provided.
sourceraw docstring

reset!clj

(reset! circuit-breaker)

Resets circuit-breaker to its original state.

Resets all metrics collected and effectively empties the contents of its ring buffers.

Resets `circuit-breaker` to its original state.

Resets all metrics collected and effectively empties the contents of its ring
buffers.
sourceraw docstring

stateclj

(state circuit-breaker)

Gets the current state of circuit-breaker.

Gets the current state of `circuit-breaker`.
sourceraw docstring

with-circuit-breakercljmacro

(with-circuit-breaker circuit-breaker & body)

Executes body within a context protected by circuit-breaker.

circuit-breaker is either a circuit breaker or the name of one in the default registry. If you provide a name and a circuit breaker of that name does not already exist in the default registry, one will be created with the :default config.

Executes `body` within a context protected by `circuit-breaker`.

`circuit-breaker` is either a circuit breaker or the name of one in the
default registry. If you provide a name and a circuit breaker of that name
does not already exist in the default registry, one will be created with the
`:default` config.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close