Function tor_circmgr::build::double_timeout

source ยท
async fn double_timeout<R, F, T>(
    runtime: &R,
    fut: F,
    timeout: Duration,
    abandon: Duration
) -> Result<T>
where R: Runtime, F: Future<Output = Result<T>> + Send + 'static, T: Send + 'static,
Expand description

Helper function: spawn a future as a background task, and run it with two separate timeouts.

If the future does not complete by timeout, then return a timeout error immediately, but keep running the future in the background.

If the future does not complete by abandon, then abandon the future completely.