Skip to main content

spawn

Function spawn 

Source
pub fn spawn<F>(handle: &Handle, future: F) -> JoinHandle<F::Output>
where F: Future + Send + 'static, F::Output: Send + 'static,
Expand description

在 Iris 运行时句柄上 spawn 一个异步任务。

需要传入 tokio::runtime::Handle,通常通过 crate::Context::handle 获取。