Liking cljdoc? Tell your friends :D
Clojure only.

d-core.libs.retriable


retriablecljmacro

(retriable max-attempts backoff-strategy retriable-errors & retriable-body)

Runs retriable-body, retrying on failures up to max-attempts total attempts.

Contracts:

  • max-attempts is the total number of attempts (includes the initial run).
  • retriable-errors is a collection of Exception classes to retry on (checked via instance?, so subclasses match).
  • backoff-strategy is a fn that receives a 1-based failure count and returns the number of milliseconds to sleep before the next attempt.

If the thrown exception is not retriable, or we have reached max-attempts, the exception is rethrown.

Runs `retriable-body`, retrying on failures up to `max-attempts` total attempts.

Contracts:
- `max-attempts` is the total number of attempts (includes the initial run).
- `retriable-errors` is a collection of Exception classes to retry on
  (checked via `instance?`, so subclasses match).
- `backoff-strategy` is a fn that receives a 1-based failure count and returns
  the number of milliseconds to sleep before the next attempt.

If the thrown exception is not retriable, or we have reached `max-attempts`,
the exception is rethrown.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close