Skip to main content

spawn_abortable_timeout

Function spawn_abortable_timeout 

Source
pub fn spawn_abortable_timeout<F>(
    duration: Duration,
    future: F,
) -> AbortableJoinHandle<Result<F::Output, TimeoutError>> 
where F: Future + Send + 'static, F::Output: Send + 'static,
Expand description

Spawns a new asynchronous task, returning an abortable handle, that must complete within duration.

If it does not, the future is dropped and the task completes with TimeoutError.