axum icon indicating copy to clipboard operation
axum copied to clipboard

Make `serve` generic over the listener and IO types

Open davidpdrsn opened this issue 1 year ago • 8 comments

Based on https://github.com/tokio-rs/axum/pull/2478

Fixes https://github.com/tokio-rs/axum/issues/2474

It's actually not as bad as I had feared so I think we can do this for 0.8.

davidpdrsn avatar Jan 01 '24 16:01 davidpdrsn

Just wanted to add a friendly +1 to these changes — this is precisely a fit for something I'm working on right now, and would make life dramatically easier as compared with the boilerplate currently necessary to do this manually.

plaidfinch avatar Jan 11 '24 21:01 plaidfinch

Is any help needed to bring this change over the finish line?

plaidfinch avatar Jan 11 '24 21:01 plaidfinch

Is any help needed to bring this change over the finish line?

Nope. Its a breaking change and don't wanna start merging breaking PRs just yet. It is done otherwise.

davidpdrsn avatar Jan 11 '24 22:01 davidpdrsn

Is any help needed to bring this change over the finish line?

I'm not involved with the project, but seeing as this is a breaking change, it's slotted for 0.8 as far as I can tell, so not sure how soon it will be until this is merged.

As a workaround for myself, I cloned the project and merged this PR specifically into the latest version. If it's viable to use for your situation, you can patch it in via the below snippet. I'm using this in prod with no issues, but YMMV obviously.

# in your Cargo.toml
[patch.crates-io]
axum = { git = "https://github.com/lojewalo/axum.git", branch = "uds-v0.7.3" }

anna-is-cute avatar Jan 11 '24 22:01 anna-is-cute

Thanks for doing that @lojewalo, I'll do that, and I'll report if I run into any sharp edges. Thanks for everyone's work on such an awesome library! 😎

plaidfinch avatar Jan 11 '24 22:01 plaidfinch

I came here via the issue #2494. If this makes it easier to accept tls connections, could you also provide an example how to do it without the axum-server crate?

I am at the moment a bit frustrated about the slow maintenance of the axum-server crate and would prefer to avoid depending on it.

kamulos avatar Mar 25 '24 13:03 kamulos

Any updates on where this stands with the maintainers? do you want to experiment with different designs or can this be merged as-is? This also solves for me a case of listening over VSOCK with something a little bit different than the regular TCP syscall-flow

elichai avatar Apr 04 '24 16:04 elichai

This is a PR by the primary maintainer, approved by the co-maintainer. It's going to land, the question is just when. Which I unfortunately can't give you any details about, you're just going to have to be patient (or use this branch via [patch]).

jplatte avatar Apr 05 '24 15:04 jplatte

This PR is added to 0.8 milestone. Will it land when 0.8 publishes?

xtexx avatar Jul 20 '24 15:07 xtexx

Yes. It will be merged some time before we publish v0.8.0.

jplatte avatar Jul 20 '24 17:07 jplatte

Closing in favor of #2941.

jplatte avatar Sep 27 '24 21:09 jplatte