Skip to main content

spawn_future

Function spawn_future 

Source
pub fn spawn_future<F>(
    callbacks: &CallbackHandle,
    priority: CallbackPriority,
    fut: F,
) -> JoinFuture<F::Output> 
where F: Future + Send + 'static, F::Output: Send + 'static,
Expand description

Spawn fut onto the callback pool behind callbacks, polled on priority-band workers. Returns immediately with a JoinFuture.

The task occupies a worker only for the duration of each poll; between polls it holds nothing (module docs). If the band’s ring is full (C S_db_bufFull) the task cannot be enqueued and the returned handle resolves as cancelled with an error logged — mirroring the fact that a tokio spawn never fails while still giving the caller a handle that resolves.