Liking cljdoc? Tell your friends :D
Clojure only.

exoscale.checkmate.sync

Retry library.

3 main states

  • success (all good)
  • error (bad, potentially retry)
  • failure (terminal failure)
  • Conditions control if we should retry and how to setup the state at first call, and how to update the state upon failures (inc retry counter for instance). Conditions are in effect, composable and should remain pure (state in/out).

You can for instance do:

;; will retry up to 3 times with a 1000ms delay between tries (cm/do! #(do-something) [(delayed-retries (constant-backoff-delays 1000)) (max-retries 3)])

  • Effects can apply side effects at various stages (ex sleep, update state machine), they are purely for io, as opposed to Conditions
Retry library.

3 main states

* success (all good)
* error (bad, potentially retry)
* failure (terminal failure)

- Conditions control if we should retry and how to setup the state
at first call, and how to update the state upon failures (inc retry
counter for instance). Conditions are in effect, composable and
should remain pure (state in/out).

You can for instance do:

;; will retry up to 3 times with a 1000ms delay between tries
(cm/do! #(do-something) [(delayed-retries (constant-backoff-delays 1000)) (max-retries 3)])

- Effects can apply side effects at various stages (ex sleep, update
state machine), they are purely for io, as opposed to Conditions
raw docstring

runclj

(run f conditions)
(run f conditions opts)

Synchronous runner, take function f and runs it. Upon error will check Conditions passed as arguments to know if it warrants a retry, otherwise it triggers a failure and rethrows the last error.

At every stage hooks are invoked, and potentially Effects from Conditions.

  • hooks: map of allow to setup event at various stages (logging, reporting)
  • conditions: sequence of Conditions to be used
Synchronous runner, take function `f` and runs it.
Upon error will check Conditions passed as arguments to know if it
warrants a retry, otherwise it triggers a failure and rethrows the
last error.

At every stage `hooks` are invoked, and potentially Effects from
Conditions.

* `hooks`: map of allow to setup event at various stages (logging, reporting)
* `conditions`: sequence of Conditions to be used
raw docstring

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

× close