You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 11, 2023. It is now read-only.
let server = Server::bind(&addr).serve(make_service);// Prepare some signal for when the server should start shutting down...let(tx, rx) = tokio::sync::oneshot::channel::<()>();let graceful = server
.with_graceful_shutdown(async{
rx.await.ok();});// Await the `server` receiving the signal...ifletErr(e) = graceful.await{eprintln!("server error: {}", e);}// And later, trigger the signal by calling `tx.send(())`.let _ = tx.send(());
For comparison, the simple "wait forever" implementation with no shutdown signal:
let server = Server::bind(&addr).serve(make_service);// Run forever-ish...ifletErr(err) = server.await{eprintln!("server error: {}", err);}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
enhancementNew feature or requestzbusIssues/PRs related to zbus crate
In GitLab by @Peelz on Jan 31, 2023, 02:08
zbus could have an API for requesting the connection to be closed.
This ties in #307
As an example, here's how hyper handles this:
For comparison, the simple "wait forever" implementation with no shutdown signal:
The text was updated successfully, but these errors were encountered: