1
0
mirror of https://github.com/actix/actix-website synced 2025-06-29 00:10:36 +02:00

Replace tokio::time::delay_for with tokio::time::sleep (#273)

This commit is contained in:
Kotaro Abe
2022-06-19 22:49:21 +09:00
committed by GitHub
parent f12f950c91
commit a85b4ff5a3

View File

@ -43,7 +43,7 @@ For this reason, any long, non-cpu-bound operation (e.g. I/O, database operation
```rust
async fn my_handler() -> impl Responder {
tokio::time::delay_for(Duration::from_secs(5)).await; // <-- Ok. Worker thread will handle other requests here
tokio::time::sleep(Duration::from_secs(5)).await; // <-- Ok. Worker thread will handle other requests here
"response"
}
```