Function spawn_local
fn spawn_local<F>(future: F) -> JoinHandle<<F as >::Output>
where
F: Future + 'static,
<F as >::Output: 'static
Spawns a !Send future on the current LocalSet or LocalRuntime.
The spawned future will run on the same thread that called spawn_local.
The provided future will start running in the background immediately
when spawn_local is called, even if you don't await the returned
JoinHandle.
Panics
This function panics if called outside of a LocalSet.
Note that if tokio::spawn is used from within a LocalSet, the
resulting new task will not be inside the LocalSet, so you must use
spawn_local if you want to stay within the LocalSet.
Examples
use Rc;
use task;
async