pub async fn poll_with_timeout<Fut, R>(
name: &str,
timeout: Duration,
f: impl Fn() -> Fut,
) -> Result<R>
Expand description
Retry until f
succeeds or timeout is reached
- if
f
return Ok(val), this returns with Ok(val). - if
f
return Err(Control::Break(err)), this returns Err(err) - if
f
return Err(ControlFlow::Continue(err)), retries until timeout reached