Function dreadnought::task::spawn_async

source ·
pub fn spawn_async<F>(
    future: F
) -> Result<JoinableAsyncTaskRef<F::Output>, &'static str>where
    F: Future + Send + 'static,
    F::Output: Send,
Expand description

Spawns a new asynchronous task, returning a JoinableAsyncTaskRef for it.

You do not need to poll the returned object to make the async task execute; it will begin running in the background immediately.

Errors

This function will return errors generated by [spawn::TaskBuilder::spawn()].