Module retry

Module retry 

Source
Expand description

Retry utilities with exponential backoff and jitter. Made public as a module so users can access retry configuration and functions for their own operations that need retry logic. Retry utilities with exponential backoff

This module provides utilities for retrying operations with configurable backoff strategies. Useful for handling transient failures when communicating with LLM servers.

§Examples

use open_agent::retry::{retry_with_backoff, RetryConfig};
use std::time::Duration;

let config = RetryConfig::default()
    .with_max_attempts(3)
    .with_initial_delay(Duration::from_secs(1));

let result = retry_with_backoff(config, || async {
    // Your async operation here
    Ok::<_, open_agent::Error>(42)
}).await?;

Structs§

RetryConfig
Configuration for retry behavior

Functions§

is_retryable_error
Determine if an error is retryable
retry_with_backoff
Retry an async operation with exponential backoff
retry_with_backoff_conditional
Retry an async operation with exponential backoff, only retrying on retryable errors