NatureWhistle. Notifier. Retry
(nature_whistle v0.3.0)
Copy Markdown
Exponential backoff helper used by HTTP delivery modules.
Slack, Teams, and Webhook all delegate request retries to this module
so the retry policy is implemented in one place.
The retry policy is configured under :nature_whistle, :retry and supports:
:max_attempts- how many total attempts should be made:base_delay_ms- the first wait period before a retry:max_delay_ms- the maximum sleep used when backoff grows
If the function supplied to with_retry/1 keeps failing, the helper returns
{:error, :max_attempts_exceeded} after the final attempt.
Summary
Functions
Executes fun with retry and exponential backoff.
Functions
Executes fun with retry and exponential backoff.
The callback must return either:
{:ok, value}to stop retrying and return success immediately{:error, reason}to trigger a retry until the attempt budget is exhausted
The delay starts at base_delay_ms, doubles after each failed attempt, and is
capped by max_delay_ms.