angzarr_client.retry

Retry policy interface and default exponential backoff implementation.

Attributes

T

Classes

RetryPolicy

Strategy for retrying failed operations.

ExponentialBackoffRetry

Retries with exponential backoff and optional jitter.

Functions

default_retry_policy(→ RetryPolicy)

Return the standard retry policy matching Rust's backoff config.

Module Contents

angzarr_client.retry.T
class angzarr_client.retry.RetryPolicy

Bases: abc.ABC

Strategy for retrying failed operations.

abstractmethod execute(operation: Callable[[], T]) T

Run the operation, retrying on failure according to the policy.

Returns the result of the first successful attempt. Raises the last exception if all attempts fail.

class angzarr_client.retry.ExponentialBackoffRetry(min_delay: float = 0.1, max_delay: float = 5.0, max_attempts: int = 10, jitter: bool = True, on_retry: Callable[[int, Exception], None] | None = None)

Bases: RetryPolicy

Retries with exponential backoff and optional jitter.

min_delay = 0.1
max_delay = 5.0
max_attempts = 10
jitter = True
on_retry = None
execute(operation: Callable[[], T]) T

Run the operation, retrying on failure according to the policy.

Returns the result of the first successful attempt. Raises the last exception if all attempts fail.

angzarr_client.retry.default_retry_policy() RetryPolicy

Return the standard retry policy matching Rust’s backoff config.