-
Notifications
You must be signed in to change notification settings - Fork 3
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
0.7.0 Legos #17
0.7.0 Legos #17
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
src/tcp.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Interesting fairly low-level management of the TCP stream, i guess in terms of handling errors and interception.
- The
tokio::stream_iter!()
also looks like a useful tool, particularly in tests - too bad yield only works within async, would love to see the generator proposal make it to prod rust. (i.e. python-like yield generators, present in many other languages); imagine some borrow-checker issues to work around given the arbitrarily complex finite state machine it might generate. Probably would need pins and possibly unsafe under the covers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice!
I learned quite a bit last week and then yet some more stuff (other patterns in tokio for example).
Very nice! I like how you don't wrap anything unnecessarily which reduces complexity, so we can use the native blocks during setup, tokio listener, hyper stream, tower service builder and rustls config. |
nit: remove or update the old changelog |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not dug deep on the networking rabbit hole of rust, yet the design seems minimal yet powerful; clean abstractions, and clean usages. Only gripe is that there are some files that don't have a single comment or doc string, would be useful for futureproofing this against later confusion (from yourself, but also for us later who will ues this lol)
* optimize: more * fix: bump package versions * fix: apples to apples * fix: fmt
🚀 0.7.0 Legos - Hyper 1.0 Migration and Server Modularization
This PR implements a major overhaul of hyper-server, migrating to hyper 1.0 and introducing a more modular, composable architecture. These changes aim to improve flexibility, performance, and maintainability while aligning with the latest hyper ecosystem.
Overall principle:
tokio::net::TcpListener
->rustls::TlsAcceptor
->hyper_util::server::conn::auto
->hyper::service::Service
->tower::Service
(optionally) ->tower::steer
(by request header, optionally) -> then onwards towardstower::* && tonic::* && axum::* && tungstenite::* && etc::towerlike::*
Leveraging streaming APIs throughout, exposing native builder APIs for complete control at each layer.
🔄 Hyper 1.0 Migration
hyper::Body
usage with appropriate alternatives (e.g.,impl Body
,BoxBody
)hyper::Server
tohyper-util::server::conn::auto::Builder
Service
andservice_fn
implementations to usehyper::service
✅ Completed Modularization (This PR)
(and thereby tonic and axum)
🚧 Pending Tasks (Future PRs)
🔍 Key Changes
👀 Review Focus
💡 This PR marks a significant evolution of hyper-server, aligning it with hyper 1.0 and introducing a more flexible architecture. Your insights are crucial as we refine this new foundation!