tokio::runtime::task

Function new_task

Source
fn new_task<T, S>(
    task: T,
    scheduler: S,
    id: Id,
) -> (Task<S>, Notified<S>, JoinHandle<T::Output>)
where S: Schedule, T: Future + 'static, T::Output: 'static,
Expand description

This is the constructor for a new task. Three references to the task are created. The first task reference is usually put into an OwnedTasks immediately. The Notified is sent to the scheduler as an ordinary notification.