Liking cljdoc? Tell your friends :D

resilience.core


executecljmacro

(execute execute-body & args)

Create a function with the execute-body, applies any wrapper functions in the args and then executes it. ex: (execute (let [data (fetch-data-from db)] (save data)) (with-breaker breaker) (with-retry retry-policy) (recover-from [CircuitBreakerOpenException ExceptionInfo] (fn [_] (log/error "circuit breaker open"))) (recover (fn [ex] (log/error ex "unexpected exception happened"))))

Create a function with the `execute-body`, applies any wrapper functions
in the `args` and then executes it.
ex: (execute
      (let [data (fetch-data-from db)]
        (save data))
      (with-breaker breaker)
      (with-retry retry-policy)
      (recover-from [CircuitBreakerOpenException ExceptionInfo]
                    (fn [_] (log/error "circuit breaker open")))
      (recover (fn [ex] (log/error ex "unexpected exception happened"))))
sourceraw docstring

execute-callable*cljmacro

(execute-callable* f)

Internal use only. Sorry for not founding a way to conceal it.

Internal use only. Sorry for not founding a way to conceal it.
sourceraw docstring

execute-with-breakercljmacro

(execute-with-breaker breaker & body)

Execute the following codes with the protection of a circuit breaker given by breaker argument.

Please try to not put clojure.core/recur in body otherwise you may get an infinite loop easily.

Execute the following codes with the protection
of a circuit breaker given by `breaker` argument.

Please try to not put `clojure.core/recur` in `body`
otherwise you may get an infinite loop easily.
sourceraw docstring

execute-with-bulkheadcljmacro

(execute-with-bulkhead bulkhead & body)

Execute the following codes with the protection of a bulkhead given by bulkhead argument.

Please try to not put clojure.core/recur in body otherwise you may get an infinite loop easily.

Execute the following codes with the protection
of a bulkhead given by `bulkhead` argument.

Please try to not put `clojure.core/recur` in `body`
otherwise you may get an infinite loop easily.
sourceraw docstring

execute-with-rate-limitercljmacro

(execute-with-rate-limiter rate-limiter & body)
source

execute-with-retrycljmacro

(execute-with-retry retry & body)

Execute the following codes with the protection of a retry policy given by retry argument.

Please try to not put clojure.core/recur in body otherwise you may get an infinite loop easily.

Execute the following codes with the protection
of a retry policy given by `retry` argument.

Please try to not put `clojure.core/recur` in `body`
otherwise you may get an infinite loop easily.
sourceraw docstring

execute-with-time-limitercljmacro

(execute-with-time-limiter timelimiter & body)

Execute the following codes with the protection of a time limiter given by time-limiter argument.

Please try to not put clojure.core/recur in body otherwise you may get an infinite loop easily.

Execute the following codes with the protection
of a time limiter given by `time-limiter` argument.

Please try to not put `clojure.core/recur` in `body`
otherwise you may get an infinite loop easily.
sourceraw docstring

recovercljmacro

(recover wraped-fn)
(recover failover-fn wraped-fn)

Like resilience.core/recover-from but will catch any exceptions inherited from java.lang.Exception. You can chose to provide a failover function which will be evaluated when any exceptions occurred. If no failover function provided, then nil will be returned any exceptions happened.

Like `resilience.core/recover-from` but will catch any exceptions inherited
from java.lang.Exception.
You can chose to provide a failover function which will be evaluated when any
exceptions occurred. If no failover function provided, then nil will
be returned any exceptions happened.
sourceraw docstring

recover-fromcljmacro

(recover-from exceptions wraped-fn)
(recover-from exceptions failover-fn wraped-fn)

Using with resilience.core/execute to recover from enumerated exceptions list. You can chose to provide a failover function which will be evaluated when one of enumerated exception occurred. If no failover function provided, then nil will be returned when exception happened.

Using with `resilience.core/execute` to recover from enumerated exceptions list.
You can chose to provide a failover function which will be evaluated when one of
enumerated exception occurred. If no failover function provided, then nil will
be returned when exception happened.
sourceraw docstring

to-fncljmacro

(to-fn & body)

Wrap body to a function.

Wrap body to a function.
sourceraw docstring

with-breakerclj

(with-breaker breaker f)

Provide a function f which has no arguments and returns a function which is decorated by a circuit breaker given by breaker argument. Usually this is used within resilience.core/execute block.

Provide a function `f` which has no arguments and returns a function
which is decorated by a circuit breaker given by `breaker` argument.
Usually this is used within `resilience.core/execute` block.
sourceraw docstring

with-bulkheadclj

(with-bulkhead bulkhead f)

Provide a function f which has no arguments and returns a function which is decorated by a bulkhead given by bulkhead argument. Usually this is used within resilience.core/execute block.

Provide a function `f` which has no arguments and returns a function
which is decorated by a bulkhead given by `bulkhead` argument.
Usually this is used within `resilience.core/execute` block.
sourceraw docstring

with-rate-limiterclj

(with-rate-limiter rate-limiter f)

Provide a function f which has no arguments and returns a function which is decorated by a rate limiter given by rate-limiter argument. Usually this is used within resilience.core/execute block.

Provide a function `f` which has no arguments and returns a function
which is decorated by a rate limiter given by `rate-limiter` argument.
Usually this is used within `resilience.core/execute` block.
sourceraw docstring

with-resilience-familycljmacro

(with-resilience-family family-members & body)

Protected forms in body with resilience family members. ex: (with-resilience-family [:retry retry-policy :breaker breaker :bulkhead bulkhead] (let [data (fetch-data-from db)] (save data))) Please remember to catch Exceptions which may thrown from resilience family members.

Protected forms in `body` with resilience family members.
ex:  (with-resilience-family
       [:retry retry-policy :breaker breaker :bulkhead bulkhead]
       (let [data (fetch-data-from db)]
         (save data)))
Please remember to catch Exceptions which may thrown from resilience family members.
sourceraw docstring

with-retryclj

(with-retry retry f)

Provide a function f which has no arguments and returns a function which is decorated by a retry policy given by retry argument. Usually this is used within resilience.core/execute block.

Provide a function `f` which has no arguments and returns a function
which is decorated by a retry policy given by `retry` argument.
Usually this is used within `resilience.core/execute` block.
sourceraw docstring

with-time-limiterclj

(with-time-limiter time-limiter f)

Provide a function f which has no arguments and returns a function which is decorated by a time limiter given by time-limiter argument. Usually this is used within resilience.core/execute block.

Provide a function `f` which has no arguments and returns a function
which is decorated by a time limiter given by `time-limiter` argument.
Usually this is used within `resilience.core/execute` block.
sourceraw docstring

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

× close