Opt-in HTTP retry with exponential backoff and jitter.
Disabled by default. Enable for idempotent operations such as OAuth token fetches:
config :daraja, :http_retry,
enabled: true,
max_attempts: 3,
base_ms: 100,
max_ms: 2_000,
jitter: trueDaraja.Auth.fetch_token/1 respects this config. Payment POST endpoints
do not retry automatically — wrap your own calls with run/2 when you
have explicit idempotency guarantees.
Summary
Functions
Runs fun/0, retrying {:error, reason} results when retry is enabled and
reason is retryable.
Types
@type config() :: %{ enabled: boolean(), max_attempts: pos_integer(), base_ms: pos_integer(), max_ms: pos_integer(), jitter: boolean() }