Open hhstore opened 2 years ago
tokio 等价概念:
use tokio::time::timeout;
use tokio::sync::oneshot;
use std::time::Duration;
let (tx, rx) = oneshot::channel();
// Wrap the future with a `Timeout` set to expire in 10 milliseconds.
if let Err(_) = timeout(Duration::from_millis(10), rx).await {
println!("did not receive value within 10 ms");
}
搜索:
tokio-context
rocket:
视频:
依赖库:
1
1
1
related: