Function tokio_executor::current_thread::spawn

source ·
pub fn spawn<F>(future: F)
where F: Future<Output = ()> + 'static,
Expand description

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.