Expand description
Unified retry policy
Provides RetryPolicy configuration and the with_retry execution wrapper,
for unified use by all external calls: LLM / MCP / A2A / Sandbox, etc.
§Example
use echo_core::retry::{RetryPolicy, with_retry};
use std::time::Duration;
let policy = RetryPolicy::new(3, Duration::from_millis(500))
.max_delay(Duration::from_secs(30))
.jitter(true);
let result = with_retry(&policy, || async {
// Potentially-failing async operation
Ok::<_, String>("success".to_string())
}).await;Structs§
- Retry
Policy - Unified retry policy configuration
Functions§
- with_
retry - Execute an async operation with the given retry policy (all errors are considered retryable).
- with_
retry_ if - Execute an async operation with the given retry policy.