maple.utils.retry.RetryConfig

class maple.utils.retry.RetryConfig(max_attempts: int = 3, delay: float = 1.0, backoff: float = 2.0, max_delay: float = 30.0, exceptions: ~typing.Tuple[~typing.Type[Exception], ...] = (<class 'Exception'>,))

Configuration container for retry behavior.

Encapsulates all retry parameters in a reusable dataclass. This allows creating named retry configurations that can be shared across multiple functions or stored as constants.

Methods

__init__(max_attempts, delay, backoff, ...)

Attributes

backoff

Multiplier applied to delay after each failed attempt.

delay

Initial delay in seconds between retry attempts.

exceptions

Tuple of exception types to catch and retry on.

max_attempts

Maximum number of execution attempts before giving up.

max_delay

Maximum delay cap in seconds.