Update web-server.md

使用了Duration::from_secs(5),需要增加对Duration的引入
pull/1272/head
Ray 1 year ago committed by GitHub
parent 9e05a2a928
commit 34646cd974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -134,6 +134,7 @@ async fn main() {
**上面的代码虽然已经是异步的,实际上它还无法并发**,原因我们后面会解释,先来模拟一下慢请求:
```rust
use std::time::Duration;
use async_std::task;
async fn handle_connection(mut stream: TcpStream) {

Loading…
Cancel
Save