Tinkex.RetryConfig (Tinkex v0.3.4)

View Source

User-facing retry configuration for sampling operations.

Mirrors the Python SDK surface (time-bounded retries with progress timeout, backoff tuning, connection limiting, enable/disable toggle). The struct is designed to be lightweight and easy to pass through opts.

Summary

Functions

Return the default retry configuration.

Build a retry configuration.

Convert to RetryHandler options.

Validate a retry configuration, raising on invalid values.

Types

t()

@type t() :: %Tinkex.RetryConfig{
  base_delay_ms: pos_integer(),
  enable_retry_logic: boolean(),
  jitter_pct: float(),
  max_connections: pos_integer(),
  max_delay_ms: pos_integer(),
  max_retries: non_neg_integer() | :infinity,
  progress_timeout_ms: pos_integer()
}

Functions

default()

@spec default() :: t()

Return the default retry configuration.

new(opts \\ [])

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

Build a retry configuration.

Accepts keyword options overriding defaults that match the Python RetryConfig defaults (0.5s base delay, 10s cap, 25% jitter, 120m progress timeout, and no retry cap unless explicitly provided).

to_handler_opts(config)

@spec to_handler_opts(t()) :: keyword()

Convert to RetryHandler options.

validate!(config)

@spec validate!(t()) :: t()

Validate a retry configuration, raising on invalid values.