livery_client_retry (livery v0.2.0)

View Source

Client layer: retry failed requests with exponential backoff.

Retries on transport errors and on the configured retryable status codes (502/503/504 by default), up to max extra attempts, sleeping Base * Factor^Attempt ms plus jitter between tries. Only idempotent methods (GET/HEAD/PUT/DELETE/OPTIONS) are retried unless retry_non_idempotent => true, and a request with a one-shot streaming body is never retried (the producer cannot be replayed). Add it with livery_client:retry/1.

Opts: max (default 2), backoff ({BaseMs, Factor}, default {200, 2.0}), statuses (default [502, 503, 504]), retry_non_idempotent (default false).

Summary

Functions

call(Req, Next, Opts)

-spec call(livery_client:request(), livery_client:next(), map()) ->
              {ok, livery_client:response()} | {error, term()}.