Skip to content

Commit

Permalink
Graceful shutdown Hyper connection (#4052)
Browse files Browse the repository at this point in the history
  • Loading branch information
Systemcluster authored Aug 6, 2024
1 parent 09e0e6d commit 33ea44f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/example-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,17 @@ pub async fn test_example(
let conn = builder.serve_connection(TokioIo::new(stream), &service);
tokio::pin!(conn);

tokio::select! {
let ret = tokio::select! {
res = conn.as_mut() => {
res.map_err(|e| anyhow::Error::msg(e.to_string()))
}
_ = rx => {
Ok(())
}
}
};

conn.graceful_shutdown();
ret
},
async {
#[derive(Deserialize)]
Expand Down

0 comments on commit 33ea44f

Please sign in to comment.