-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Changes the return value of Connection::into_parts
in the server upgrade API
#1471
Comments
Hm, I suppose on the server side, it should be possible to return the service with Care must be taken by the user since the service manages every request on the connection, and so bugs could exist if you set state on your service incorrectly, but I don't think this change makes this bug any easier to do. You'd have the same possibility with the channel example that you showed initially. The good news is that the |
It is right that the attention to implementation is required. I've also noticed that this method cannot deal with the context generated after calling A better way is that |
I think it's probably best to not try to address that possible issue yet, and see if it is a problem in practice. If it is, we could do something to employ |
I've understood. Continually use the current API and identify the problems. |
This allows getting the original service back. Closes #1471
This was done and is part of 0.11.24. |
This allows getting the original service back. Closes hyperium#1471 Cherry-pick of commit bf7c0bb from the 0.11.x branch.
In the upgrade API provided by the current master, the fields of
Parts<T>
returned frominto_parts()
are only the underling I/O and buffer. In order to pass the context genereted within theService::call
to the task of lower layer, it is necessary to use the message passing using the channel as follows:Using such a method complicates the connection between the
Service
layer and the lower connection task. To avoid this, the modification of the upgrade API by adding additional field to the return value fromConnection::into_parts()
is required.My suggestion is to add the value of
Service
used in HTTP as follows:Is it possible to make such changes?
The text was updated successfully, but these errors were encountered: