1
0
mirror of https://github.com/actix/actix-website synced 2025-01-22 16:15:56 +01: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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ For this reason, any long, non-cpu-bound operation (e.g. I/O, database operation
```rust ```rust
async fn my_handler() -> impl Responder { 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" "response"
} }
``` ```