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§
- Retry
Config - 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