pub async fn retry<T, F, R>(retry_future: F) -> Result<R, Error>
Expand description
Retry a future until it doesn’t return a disconnected error.
§Example
use subxt::backend::utils::retry;
async fn some_future() -> Result<(), subxt::error::Error> {
Ok(())
}
#[tokio::main]
async fn main() {
let result = retry(|| some_future()).await;
}