adk_retry (erlang_adk v0.2.5)

View Source

adk_retry - Retry mechanism with exponential backoff.

Summary

Functions

Execute a function with default retry options.

Types

retry_opts/0

-type retry_opts() ::
          #{max_attempts => pos_integer(),
            initial_delay => pos_integer(),
            max_delay => pos_integer(),
            backoff_factor => float()}.

Functions

execute(Fun, Opts)

-spec execute(Fun :: fun(() -> {ok, term()} | {error, term()}), retry_opts()) ->
                 {ok, term()} | {error, term()}.

Execute a function with default retry options.

execute(Fun, AttemptsLeft, Delay, Opts)