axum-server
axum-server copied to clipboard
What do you think about adding method `with_graceful_shutdown()` like in Axum?
What do you think about adding method with_graceful_shutdown() like in Axum?
Have you considered this?
let handle = axum_server::Handle::default();
let handle_clone = handle.clone();
tokio::spawn(async move {
// TODO: what you would have put in `with_graceful_shutdown`
handle_clone.graceful_shutdown(Some(Duration::from_secs(1)));
});
axum_server::bind(...)
.handle(handle)
.serve(...)
.await