-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make <Serve as Future>::Output = ! #3164
Comments
@SabrinaJewson I guess we could have merged the docs aspect of the PR / still merge it now. Do you want to open a new PR for that? |
Right, PR sent. In writing that PR, a thought came to mind: currently, in Another thought that comes to mind is that it’s a performance hazard to run Which is to say, I could envisage an API that looks more like this: let server = axum::serve(listener, router);
tokio::signal::ctrl_c().await?;
server.graceful_shutdown().await; Of course, There is a drawback to this API, however, which is that axum::serve_builder(listener, router)
.set_some_config(some_value)
.build()
.await Or alternatively, have a // option A:
axum::serve(listener, router).await
// option B, for graceful shutdown:
let server = axum::serve(listener, router).start();
tokio::signal::ctrl_c().await?;
server.graceful_shutdown().await; One feature of this API is that |
See #2895. The PR conflicted with other ongoing work so it was not merged, but the idea was good and I think we should revisit it for the next breaking-change release. (unfortunately forgot to do it for 0.8)
The text was updated successfully, but these errors were encountered: