maple.utils.retry

Retry utilities file.

This module provides decorators and utilities for automatic retry logic with exponential backoff. It helps handle transient failures in network operations, API calls, and other potentially flaky operations.

Key features: - Configurable retry attempts with exponential backoff - Exception filtering (retry only specific exception types) - Maximum delay cap to prevent excessive waiting - Decorator and functional retry patterns - Dataclass-based configuration for reusability - Comprehensive logging of retry attempts

The retry mechanism uses exponential backoff to gradually increase wait times between attempts, reducing load on failing systems while still providing reasonable retry intervals for transient failures.

Classes

RetryConfig(max_attempts, delay, backoff, ...)

Configuration container for retry behavior.

Functions

retry(max_attempts, delay, backoff, ...)

Decorator that adds automatic retry logic with exponential backoff.

retry_call(func, ~maple.utils.retry.T], ...)

Functional interface for retrying a callable with arguments.