> ## Documentation Index
> Fetch the complete documentation index at: https://docs.askui.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retry

<a id="askui.retry.Retry" />

## askui.retry.Retry

```python theme={null}
class Retry(ABC)
```

Abstract base class for implementing retry mechanisms.

This abstract class defines the interface for retry mechanisms. Concrete
implementations should define how the retry logic works by implementing
the abstract `attempt` method.

**Example**:

```python theme={null}
class MyRetry(Retry):
    def attempt(self, func: Callable[..., R]) -> R:
        # Custom retry implementation
        return func()

retry = MyRetry()
result = retry.attempt(some_function)
```

<a id="askui.retry.Retry.attempt" />

#### attempt

```python theme={null}
def attempt(func: Callable[..., R]) -> R
```

Attempt to execute a function with retry logic.

**Arguments**:

* `func` - The function to execute with retry logic

**Returns**:

The result of the function execution

**Raises**:

* `Exception` - Any exception that occurs during execution after
  all retry attempts are exhausted

<a id="askui.retry.ConfigurableRetry" />

## askui.retry.ConfigurableRetry

```python theme={null}
class ConfigurableRetry(Retry)
```

A configurable retry implementation with different strategies.

This class provides a flexible way to retry operations that may fail temporarily,
supporting different retry strategies (Exponential, Fixed, Linear) and configurable
parameters for delay and retry count.

**Arguments**:

* `on_exception_types` *Tuple\[Type\[Exception]]* - Tuple of exception types that should trigger a retry
* `strategy` *Literal\["Exponential", "Fixed", "Linear"]* - The retry strategy to use:
  * `"Exponential"`: Delay increases exponentially between retries
  * `"Fixed"`: Constant delay between retries
  * `"Linear"`: Delay increases linearly between retries
* `base_delay` *int, optional* - Base delay in milliseconds between retries.
* `retry_count` *int, optional* - Maximum number of retry attempts.

**Example**:

```python theme={null}
retry = ConfigurableRetry(
    on_exception_types=(ConnectionError, TimeoutError),
    strategy="Exponential",
    base_delay=1000,
    retry_count=3
)
result = retry.attempt(some_function)
```
