[][src]Function tokio::runtime::current_thread::spawn

pub fn spawn<F>(future: F) where
    F: Future<Item = (), Error = ()> + 'static, 

Executes a future on the current thread.

The provided future must complete or be canceled before run will return.

Unlike tokio::spawn, this function will always spawn on a CurrentThread executor and is able to spawn futures that are not Send.

Panics

This function can only be invoked from the context of a run call; any other use will result in a panic.