Skip to content

Multiple Listeners: Why not multiple axum::serve ? #2949

Answered by mladedav
moranbw asked this question in Q&A
Discussion options

You must be logged in to vote

In an ideal world, I think it would be better to have it in one serve just so you can't add one later to one serve and forget to add it for althe other one. Unless that's what you want of course.

But I don't see practical issues with multiple concurrent serve calls. Well one that I can think of is that if a user fails to set non-blocking mode on ther TCP listeners then they'll be surprised that one of the servers doesn't seem to work at all. With single listener they'll blocking but it should just work by accident.

I think it should be just fine to get rid of the example since now it's needlessly complicated and the way to do this soon-ish will probably be to implement a Listener in 0.8 t…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@mladedav
Comment options

Answer selected by moranbw
@moranbw
Comment options

@jplatte
Comment options

@moranbw
Comment options

@mladedav
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants