Tide could store JoinHandle of every request it handles, and await them when server is shutting down.
|
task::spawn(async move { |
|
let res = async_h1::accept(&addr, stream, |req| async { |
|
let res = this.respond(req).await; |
|
let res = res.map_err(|_| io::Error::from(io::ErrorKind::Other))?; |
|
Ok(res) |
|
}) |
|
.await; |
|
|
|
if let Err(err) = res { |
|
log::error!("async-h1 error", { error: err.to_string() }); |
|
} |
|
}); |
async-std book
Tide could store
JoinHandleof every request it handles, andawaitthem when server is shutting down.tide/src/server.rs
Lines 300 to 311 in 7d0b848
async-std book