Exponential back-off retry with full jitter.
Uses :crypto.strong_rand_bytes/1 for cryptographically safe jitter.
Retries on HTTP 429 and 5xx. Does not retry 4xx (except 429).
Summary
Functions
Executes fun with retry logic.
Types
@type opts() :: %{ max_retries: non_neg_integer(), base_delay_ms: pos_integer(), max_delay_ms: pos_integer() }
Functions
@spec with_retry( (non_neg_integer() -> {:ok, any()} | {:error, Wise.Error.t()}), opts() ) :: {:ok, any()} | {:error, Wise.Error.t()}
Executes fun with retry logic.
fun must return {:ok, result} or {:error, Wise.Error.t()}.