---
title: prefactor_http.retry module
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

# prefactor_http.retry module

Retry logic with exponential backoff and jitter.

### *class* prefactor_http.retry.RetryHandler(config: [HttpClientConfig](prefactor_http.config.md#prefactor_http.config.HttpClientConfig))

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

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**](prefactor_http.md#prefactor_http.PrefactorRetryExhaustedError) – When all retry attempts are exhausted.