TypeSafeSDK.RetryPolicy (TypeSafeSDK v0.4.0)

Copy Markdown View Source

Retry configuration matching the public policy of the supplied Python SDK.

max_retries counts retries after the initial request. Backoff values are in seconds at this public boundary and are translated to Pristine milliseconds. HTTP status membership is applied through the provider profile, so per-client and per-call status overrides affect actual retry classification.

Summary

Types

t()

@type t() :: %TypeSafeSDK.RetryPolicy{
  api_connection_error: boolean(),
  api_timeout_error: boolean(),
  backoff_initial: number(),
  backoff_jitter: float(),
  backoff_max: number(),
  http_statuses: MapSet.t(integer()) | [integer()],
  max_retries: non_neg_integer(),
  respect_retry_after: boolean(),
  timeout: number() | nil
}

Functions

default_http_statuses()

@spec default_http_statuses() :: MapSet.t(integer())

merge(base, override)

@spec merge(t() | false | nil, t() | keyword() | map() | false | nil) ::
  {:ok, t() | false} | {:error, TypeSafeSDK.Error.t()}

Merge a per-call retry override into a client policy.

Omitted keys inherit from the client policy. false explicitly disables retries. A complete %RetryPolicy{} is already fully resolved and replaces the inherited policy. When a disabled client is explicitly re-enabled with a keyword/map override, omitted fields inherit the SDK policy defaults.

merge!(base, override)

@spec merge!(t() | false | nil, t() | keyword() | map() | false | nil) :: t() | false

new(opts \\ [])

@spec new(keyword() | map()) :: {:ok, t()} | {:error, TypeSafeSDK.Error.t()}

new!(opts \\ [])

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

to_pristine_opts(policy)

@spec to_pristine_opts(t() | false | nil) :: keyword()