How do I translate a simple server with graceful shutdown to axum 0.7? #2403
-
SummaryFormer code (axum 0.6):
How does this look like in axum 0.7? Without the graceful shutdown, I understand that this would simply translate using the new I saw an example that does exactly this, but it introduces 100 lines or so of boilerplate: https://github.com/tokio-rs/axum/blob/main/examples/graceful-shutdown/src/main.rs Is this possible without all the boilerplate, and instead with just a simple method call, as it was before? axum version0.7.1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Please see the comment at the top of the file https://github.com/tokio-rs/axum/blob/main/examples/graceful-shutdown/src/main.rs#L8-L9. If there was an easier way to do it then that's what we'd use in the example. Unfortunately there is not but we're working on adding it #2398. Its currently blocked by hyper. |
Beta Was this translation helpful? Give feedback.
Please see the comment at the top of the file https://github.com/tokio-rs/axum/blob/main/examples/graceful-shutdown/src/main.rs#L8-L9.
If there was an easier way to do it then that's what we'd use in the example. Unfortunately there is not but we're working on adding it #2398. Its currently blocked by hyper.