Function with_retry

Source
pub async fn with_retry<F, Fut, T>(
    config: &RetryConfig,
    operation_name: &str,
    operation: F,
) -> Result<T>
where F: Fn() -> Fut, Fut: Future<Output = Result<T>>,
Expand description

Execute an async operation with retry logic.

§Arguments

  • config - Retry configuration
  • operation - The async operation to retry
  • operation_name - Name for logging purposes

§Returns

The result of the operation, or the last error if all retries failed.