Functions to create and execute circuit breakers.
Functions to create and execute circuit breakers.
(circuit-breaker name config)
Creates a circuit breaker with the specified name and config.
Creates a circuit breaker with the specified name and config.
(circuit-breaker! name)
(circuit-breaker! name config)
Creates or fetches a circuit breaker with the specified name and config and stores it in the global registry.
The config value can be either a config map or the name of a config map stored in the global registry.
If the circuit breaker already exists in the global registry, the config value is ignored.
Creates or fetches a circuit breaker with the specified name and config and stores it in the global registry. The config value can be either a config map or the name of a config map stored in the global registry. If the circuit breaker already exists in the global registry, the config value is ignored.
(close! circuit-breaker)
Transitions the circuit breaker to the :closed
state.
Transitions the circuit breaker to the `:closed` state.
(configure-registry! configs-map)
Overwrites the global registry with one that contains the configs-map.
configs-map is a map whose keys are names and vals are configs. When a circuit breaker is created, you may specify one of the names in this map to use as the config for that circuit breaker.
:default is a special name. It will be used as the config for circuit breakers that do not specify a config to use.
Overwrites the global registry with one that contains the configs-map. configs-map is a map whose keys are names and vals are configs. When a circuit breaker is created, you may specify one of the names in this map to use as the config for that circuit breaker. :default is a special name. It will be used as the config for circuit breakers that do not specify a config to use.
(disable! circuit-breaker)
Transitions the 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 the 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.
(execute circuit-breaker f & args)
Apply args to f within a context protected by the circuit breaker.
Apply args to f within a context protected by the circuit breaker.
(force-open! circuit-breaker)
Transitions the 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 the 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.
(half-open! circuit-breaker)
Transitions the circuit breaker to the :half-open
state.
Transitions the circuit breaker to the `:half-open` state.
(name circuit-breaker)
Gets the name of the circuit breaker.
Gets the name of the circuit breaker.
(open! circuit-breaker)
Transitions the circuit breaker to the :open
state.
Transitions the circuit breaker to the `:open` state.
The global circuit breaker and config registry.
The global circuit breaker and config registry.
(state circuit-breaker)
Gets the current state of the circuit breaker.
Gets the current state of the circuit breaker.
(with-circuit-breaker circuit-breaker & body)
Executes body within a context protected by the circuit breaker.
circuit-breaker
is either a circuit breaker or the name of one in the global
registry. If you provide a name and a circuit breaker of that name does not
already exist in the global registry, one will be created with the :default
config.
Executes body within a context protected by the circuit breaker. `circuit-breaker` is either a circuit breaker or the name of one in the global registry. If you provide a name and a circuit breaker of that name does not already exist in the global registry, one will be created with the `:default` config.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close