Anthropic::RetryPolicy
Retry policy for transient API errors.
Constants
DEFAULT_BACKOFF_FACTOR = 2.0
DEFAULT_BASE_DELAY = 1.second
DEFAULT_MAX_DELAY = 10.seconds
DEFAULT_MAX_RETRIES = 2
Default: 2 retries with exponential backoff (1s, 2s, max 10s)
Constructors
new(max_retries : Int32 = DEFAULT_MAX_RETRIES, base_delay : Time::Span = DEFAULT_BASE_DELAY, max_delay : Time::Span = DEFAULT_MAX_DELAY, backoff_factor : Float64 = DEFAULT_BACKOFF_FACTOR)
SourceClass methods
Instance methods
backoff_factor
Sourcebase_delay
SourceCalculate delay for a given attempt number (0-indexed). Uses exponential backoff: base_delay * (backoff_factor ^ attempt)
max_delay
Sourcemax_retries
Source