Skip to main content

spawn_after

Function spawn_after 

Source
pub fn spawn_after<F, T>(delay: Duration, future: F) -> JoinHandle<T>
where F: Future<Output = T> + Send + 'static, T: Send + 'static,
Expand description

spawn 一个延迟执行的任务(对齐 Swoole\Timer::after($ms, $callback)

delay 后执行 future,返回 JoinHandle<T>