GelotvBot.RetryPolicy (GeloTVBot v0.1.0)

Copy Markdown View Source

Bounded retry/backoff policy for transient platform send failures.

Adapters can return {:error, {:rate_limited, retry_after_ms}} to let the dispatcher sleep for a platform-provided interval before retrying. Other retryable errors use exponential backoff with a configurable cap.

Summary

Types

t()

@type t() :: %GelotvBot.RetryPolicy{
  base_backoff: pos_integer(),
  max_attempts: pos_integer(),
  max_backoff: pos_integer()
}

Functions

new(policy)

@spec new(keyword() | t()) :: t()

retry_delay(arg1, attempt, policy)

@spec retry_delay(term(), pos_integer(), t()) :: {:retry, non_neg_integer()} | :halt