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:
parent
f12f950c91
commit
a85b4ff5a3
@ -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"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user