Liking cljdoc? Tell your friends :D

resilience.bulkhead


*bulkhead-name*clj

Contextual value represents bulkhead name

Contextual value represents bulkhead name
sourceraw docstring

*creation-time*clj

Contextual value represents event create time

Contextual value represents event create time
sourceraw docstring

acquire-permissionclj

(acquire-permission bulkhead)

Acquires a permission to execute a call, only if one is available at the time of invocation If the current thread is interrupted while waiting for a permit then it won't throw InterruptedException, but its interrupt status will be set.

Acquires a permission to execute a call, only if one is available at the time of invocation
If the current thread is interrupted while waiting for a permit
then it won't throw InterruptedException, but its interrupt status will be set.
sourceraw docstring

bulkheadclj

(bulkhead name)
(bulkhead name config)

Create a bulkhead with a name and a default or custom bulkhead configuration.

The name argument is only used to register this newly created bulkhead to a BulkheadRegistry. If you don't want to bind this bulkhead with a BulkheadRegistry, the name argument is ignored.

Please refer to bulkhead-config for allowed key value pairs within the bulkhead configurations map.

If you want to register this bulkhead to a BulkheadRegistry, you need to put :registry key with a BulkheadRegistry in the config argument. If you do not provide any other configurations, the newly created bulkhead will inherit bulkhead configurations from this provided BulkheadRegistry Example: (bulkhead my-bulkhead {:registry my-registry})

If you want to register this bulkhead to a BulkheadRegistry and you want to use new bulkhead configurations to overwrite the configurations inherited from the registered BulkheadRegistry, you need not only provide the :registry key with the BulkheadRegistry in config argument but also provide other bulkhead configurations you'd like to overwrite. Example: (bulkhead my-bulkhead {:registry my-registry :max-wait-millis 50})

If you only want to create a bulkhead and not register it to any BulkheadRegistry, you just need to provide bulkhead configurations in config argument. The name argument is ignored.

Create a bulkhead with a `name` and a default or custom bulkhead configuration.

The `name` argument is only used to register this newly created bulkhead
to a BulkheadRegistry. If you don't want to bind this bulkhead with
a BulkheadRegistry, the `name` argument is ignored.

Please refer to `bulkhead-config` for allowed key value pairs
within the bulkhead configurations map.

If you want to register this bulkhead to a BulkheadRegistry,
you need to put :registry key with a BulkheadRegistry in the `config`
argument. If you do not provide any other configurations, the newly created
bulkhead will inherit bulkhead configurations from this
provided BulkheadRegistry
Example:
(bulkhead my-bulkhead {:registry my-registry})

If you want to register this bulkhead to a BulkheadRegistry
and you want to use new bulkhead configurations to overwrite the configurations
inherited from the registered BulkheadRegistry,
you need not only provide the :registry key with the BulkheadRegistry in `config`
argument but also provide other bulkhead configurations you'd like to overwrite.
Example:
(bulkhead my-bulkhead {:registry my-registry
                       :max-wait-millis 50})

If you only want to create a bulkhead and not register it to any
BulkheadRegistry, you just need to provide bulkhead configurations in `config`
argument. The `name` argument is ignored.
sourceraw docstring

bulkhead-configclj

(bulkhead-config opts)

Create a BulkheadConfig.

Allowed options are:

  • :max-concurrent-calls Configures the max amount of concurrent calls the bulkhead will support.

  • :max-wait-millis Configures a maximum amount of time in ms the calling thread will wait to enter the bulkhead. If bulkhead has space available, entry is guaranteed and immediate. If bulkhead is full, calling threads will contest for space, if it becomes available. :max-wait-millis can be set to 0.

  • :writable-stack-trace-enabled Enables writable stack traces. When set to false, Exception#getStackTrace() returns a zero length array. This may be used to reduce log spam when the circuit breaker is open as the cause of the exceptions is already known (the circuit breaker is short-circuiting calls).

    Note: for threads running on an event-loop or equivalent (rx computation pool, etc), setting :max-wait-time to 0 is highly recommended. Blocking an event-loop thread will most likely have a negative effect on application throughput.

Create a BulkheadConfig.

Allowed options are:
* :max-concurrent-calls
  Configures the max amount of concurrent calls the bulkhead will support.

* :max-wait-millis
  Configures a maximum amount of time in ms the calling thread will wait
  to enter the bulkhead. If bulkhead has space available, entry is
  guaranteed and immediate. If bulkhead is full, calling threads will
  contest for space, if it becomes available. :max-wait-millis can be set to 0.

* :writable-stack-trace-enabled
  Enables writable stack traces. When set to false, Exception#getStackTrace() returns a zero length array.
  This may be used to reduce log spam when the circuit breaker is open as the cause of the exceptions is already
  known (the circuit breaker is short-circuiting calls).

  Note: for threads running on an event-loop or equivalent (rx computation
  pool, etc), setting :max-wait-time to 0 is highly recommended. Blocking an
  event-loop thread will most likely have a negative effect on application
  throughput.
 
sourceraw docstring

change-config!clj

(change-config! bulkhead config)

Dynamic bulkhead configuration change. NOTE! New :max-wait-millis config won't affect threads that are currently waiting for permission.

Dynamic bulkhead configuration change. NOTE! New `:max-wait-millis` config won't affect threads
that are currently waiting for permission.
sourceraw docstring

configclj

(config bulkhead)

Get the Metrics of this Bulkhead

Get the Metrics of this Bulkhead
sourceraw docstring

defbulkheadcljmacro

(defbulkhead name)
(defbulkhead name config)

Define a bulkhead under name with a default or custom configuration.

Please refer to bulkhead-config for allowed key value pairs within the bulkhead configuration.

If you want to register this bulkhead to a BulkheadRegistry, you need to put :registry key with a BulkheadRegistry in the config argument. If you do not provide any other configurations, the newly created bulkhead will inherit bulkhead configurations from this provided BulkheadRegistry Example: (defbulkhead my-bulkhead {:registry my-registry})

If you want to register this bulkhead to a BulkheadRegistry and you want to use new bulkhead configurations to overwrite the configurations inherited from the registered BulkheadRegistry, you need not only provide the :registry key with the BulkheadRegistry in config argument but also provide other bulkhead configurations you'd like to overwrite. Example: (defbulkhead my-bulkhead {:registry my-registry :max-wait-millis 50})

If you only want to create a bulkhead and not register it to any BulkheadRegistry, you just need to provide bulkhead configuration in config argument without :registry keyword.

Define a bulkhead under `name` with a default or custom configuration.

Please refer to `bulkhead-config` for allowed key value pairs
within the bulkhead configuration.

If you want to register this bulkhead to a BulkheadRegistry,
you need to put :registry key with a BulkheadRegistry in the `config`
argument. If you do not provide any other configurations, the newly created
bulkhead will inherit bulkhead configurations from this
provided BulkheadRegistry
Example:
(defbulkhead my-bulkhead {:registry my-registry})

If you want to register this bulkhead to a BulkheadRegistry
and you want to use new bulkhead configurations to overwrite the configurations
inherited from the registered BulkheadRegistry,
you need not only provide the :registry key with the BulkheadRegistry in `config`
argument but also provide other bulkhead configurations you'd like to overwrite.
Example:
(defbulkhead my-bulkhead {:registry my-registry
                          :max-wait-millis 50})

If you only want to create a bulkhead and not register it to any
BulkheadRegistry, you just need to provide bulkhead configuration in `config`
argument without :registry keyword.
sourceraw docstring

defregistrycljmacro

(defregistry name)
(defregistry name config)

Define a BulkheadRegistry under name with a default or custom bulkhead configuration.

Please refer to bulkhead-config for allowed key value pairs within the bulkhead configuration map.

Define a BulkheadRegistry under `name` with a default or custom
bulkhead configuration.

Please refer to `bulkhead-config` for allowed key value pairs
within the bulkhead configuration map.
sourceraw docstring

get-all-bulkheadsclj

(get-all-bulkheads registry)

Get all bulkhead registered to this bulkhead registry instance

Get all bulkhead registered to this bulkhead registry instance
sourceraw docstring

metricsclj

(metrics bulkhead)

Get the BulkheadConfig of this Bulkhead

Get the BulkheadConfig of this Bulkhead
sourceraw docstring

nameclj

(name bulkhead)

Get the name of this Bulkhead

Get the name of this Bulkhead
sourceraw docstring

on-completeclj

(on-complete bulkhead)

Records a completed call.

Records a completed call.
sourceraw docstring

registry-with-configclj

(registry-with-config config)

Create a BulkheadRegistry with a bulkhead configurations map.

Please refer to bulkhead-config for allowed key value pairs within the bulkhead configuration map.

Create a BulkheadRegistry with a bulkhead configurations map.

Please refer to `bulkhead-config` for allowed key value pairs
within the bulkhead configuration map.
sourceraw docstring

release-permissionclj

(release-permission bulkhead)

Releases a permission and increases the number of available permits by one. Should only be used when a permission was acquired but not used. Otherwise use on-complete(bulkhead) to signal a completed call and release a permission.

Releases a permission and increases the number of available permits by one.
Should only be used when a permission was acquired but not used. Otherwise use
on-complete(bulkhead) to signal a completed call and release a permission.
sourceraw docstring

set-on-all-event-consumer!clj

(set-on-all-event-consumer! bulkhead consumer-fn-map)
source

set-on-call-finished-event-consumer!clj

(set-on-call-finished-event-consumer! bulkhead consumer-fn)
source

set-on-call-permitted-event-consumer!clj

(set-on-call-permitted-event-consumer! bulkhead consumer-fn)

set a consumer to consume on-call-permitted event which emitted when request permitted by bulkhead. consumer-fn accepts a function which takes no arguments.

Please note that in consumer-fn you can get the bulkhead name and the creation time of the consumed event by accessing *bulkhead-name* and *creation-time* under this namespace.

set a consumer to consume `on-call-permitted` event which emitted when request permitted by bulkhead.
`consumer-fn` accepts a function which takes no arguments.

Please note that in `consumer-fn` you can get the bulkhead name and the creation time of the
consumed event by accessing `*bulkhead-name*` and `*creation-time*` under this namespace.
sourceraw docstring

set-on-call-rejected-event-consumer!clj

(set-on-call-rejected-event-consumer! bulkhead consumer-fn)
source

try-acquire-permissionclj

(try-acquire-permission bulkhead)

Acquires a permission to execute a call, only if one is available at the time of invocation. If the current thread is interrupted while waiting for a permit then it won't throw InterruptedException, but its interrupt status will be set.

Acquires a permission to execute a call, only if one is available at the time of invocation.
If the current thread is interrupted while waiting for a permit then it won't throw
InterruptedException, but its interrupt status will be set.
sourceraw docstring

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

× close