execute_task_until_timeout

Function execute_task_until_timeout 

Source
pub async fn execute_task_until_timeout<Task, Duration>(
    task: Task,
    duration: Duration,
) -> JoinHandle<TaskTimeoutResult<Task::Output>>
where Task: Future + Send + 'static, Task::Output: Send, Duration: Into<Duration>,
Expand description

Executes an async task until timeout of provided duration on a different task. Returns an ExecuteTaskResult::Completed(Result) If the task was executed until completion where Result is the return type of the task Returns an ExecuteTaskResult::Timeout otherwise.