Skip to content

Conversation

@jplatte
Copy link
Member

@jplatte jplatte commented Oct 10, 2024

Motivation

Our benchmark calls axum::Serve::into_future outside of a tokio context and currently panics because of it. I could have also updated the benchmark, but this seems like a thing that should be supported. It might increase the size of the (heap-allocated) future, but that's just a few bytes per axum::serve.

Solution

Don't eagerly tokio::spawn the graceful-shutdown task in into_future.

@jplatte jplatte requested review from mladedav and yanns October 10, 2024 20:14
@jplatte jplatte merged commit a0f310a into main Oct 11, 2024
18 checks passed
@jplatte jplatte deleted the jplatte/serve-future-no-tokio branch October 11, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants