-
Notifications
You must be signed in to change notification settings - Fork 125
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
Update hyper to 0.14 and tokio/bytes to 1.0 #511
Conversation
6ed2b9b
to
669dd4c
Compare
Codecov Report
@@ Coverage Diff @@
## master #511 +/- ##
=======================================
Coverage 85.54% 85.54%
=======================================
Files 109 109
Lines 5569 5577 +8
=======================================
+ Hits 4764 4771 +7
- Misses 805 806 +1
Continue to review full report at Codecov.
|
669dd4c
to
02ec42e
Compare
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.
Yay websockets
Would it make sense to just expose the Extensions on the state directly, given that this is what Gotham does for the other parts that come from Hyper? For context, the reason I'm asking is because I'd like to send a PR to expose those, but if I'm exposing extensions, it's a little awkward if this one isn't there and has to be obtained from the State instead. Given this version hasn't been released yet, maybe there's time to reconsider this decision? :) |
We could just put the extensions into the state directly. Since there seems to be no way of getting an iterator over all extensions, this might be the only way for now, especially for non-standard extensions that gotham can't know about. However, it feels a bit weird since both The only alternative I can think of is providing a method that allows the user to process extensions and put them into the state - which I'm not a fan of since it'd involve a second type of middleware that'd probably just make stuff more complicated. |
This PR updates hyper to 0.14 and tokio and bytes to 1.0.
The websocket example has been disabled as tokio-tungstenite has not yet been updated (PR: snapview/tokio-tungstenite#142).The websocket example has also been updated. Unfortunately, hyper no longer accepts upgrades on theBody
type but requiresOnUpgrade
from the http requests extensions, so I put that type into the state whenever it appears in the request.Note: hyper split up their code behind several feature flags. As of right now, gotham basically needs all features, since we have built-in test functionality that also depends on the client side of hyper. We might want to also expose feature flags that only depend on the hyper client code if we enabled our test code.