Expand description
Automatic retry with exponential backoff.
This module provides retry functionality for handling transient failures in API calls. It implements exponential backoff with optional jitter to prevent thundering herd problems.
§Example
ⓘ
use aptos_sdk::retry::{RetryConfig, RetryPolicy};
// Create a custom retry policy
let config = RetryConfig::builder()
.max_retries(5)
.initial_delay_ms(100)
.max_delay_ms(10_000)
.exponential_base(2.0)
.jitter(true)
.build();
// Use with the Aptos client
let aptos = Aptos::new(AptosConfig::testnet().with_retry(config))?;Structs§
- Retry
Config - Configuration for retry behavior.
- Retry
Config Builder - Builder for
RetryConfig. - Retry
Executor - Executes an async operation with automatic retry.
Traits§
- Retry
Ext - Extension trait for adding retry capability to futures.
Functions§
- retry
- Convenience function to retry an operation with default config.
- retry_
with_ config - Convenience function to retry an operation with custom config.