Skip to content

Commit

Permalink
doc: update docstring for retry policy and block
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Oct 2, 2023
1 parent 81ab59c commit f45018a
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/diehard/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@
`exception` as arguments, called when max retries or max duration have
been exceeded.
Note that exceptions thrown from listeners will not throw in retry blocks.
##### Use pre-defined policy
You can put together all those retry policies in a `defretrypolicy`.
Expand Down Expand Up @@ -276,6 +278,8 @@ the last execution. If `:circuit-breaker` is set, it will throw
* `:on-retries-exceeded` accepts a function which takes `result` and
`exception` as arguments, called when retries exceeded
Note that exceptions thrown from listeners will not throw in retry blocks.
##### Use pre-defined policy
You can put together all those retry policies in a `defretrypolicy`.
Expand All @@ -291,24 +295,6 @@ And use `:policy` option in option map.
)
```
##### Retry Listeners
* `:on-abort` accepts a function which takes `result`, `exception` as
arguments, called when retry aborted
* `:on-complete` accepts a function which takes `result`, `exception` as
arguments, called when exiting `retry` block
* `:on-failed-attempt` accepts a function which takes `result`,
`exception` as arguments, called when execution failed (matches
retry criteria)
* `:on-failure` accepts a function which takes `result`,
`exception` as arguments, called when exiting `retry` block with
failure (matches retry criteria)
* `:on-success` accepts a function which takes `result` as arguments,
called when exiting `retry` block with success (mismatches retry
criteria)
* `:on-retry` accepts a function which takes `result` as arguments,
called when a retry attempted.
##### Fallback
* `:fallback` fallback value or handler function when retry blocks
Expand Down

0 comments on commit f45018a

Please sign in to comment.