[−][src]Function juliex::spawn
pub fn spawn<F>(future: F) where
F: Future<Output = ()> + Send + 'static,
Spawn a task on the threadpool.
Example
ⓘThis example is not tested
#![feature(async_await, await_macro, futures_api)] use std::thread; use futures::executor; fn main() { for _ in 0..10 { juliex::spawn(async move { let id = thread::current().id(); println!("Running on thread {:?}", id); }) } }