Skip to content

prefactor_http.retry module

Retry logic with exponential backoff and jitter.

Bases: object

Handles retry logic with exponential backoff and jitter.

async execute(operation: Callable[[…], Any], is_retryable: Callable[[Exception], bool], *args: Any, **kwargs: Any) → Any

Section titled “async execute(operation: Callable[[…], Any], is_retryable: Callable[[Exception], bool], *args: Any, **kwargs: Any) → Any”

Execute an operation with retry logic.

  • Parameters:
    • operation – Async function to execute.
    • is_retryable – Function that determines if an exception is retryable.
    • *args – Positional arguments for the operation.
    • **kwargs – Keyword arguments for the operation.
  • Returns: Result of the operation.
  • Raises: PrefactorRetryExhaustedError – When all retry attempts are exhausted.