feat(ext): add ext::on_informational() callback extension#3818
Merged
seanmonstar merged 1 commit intomasterfrom Jan 27, 2025
Merged
feat(ext): add ext::on_informational() callback extension#3818seanmonstar merged 1 commit intomasterfrom
ext::on_informational() callback extension#3818seanmonstar merged 1 commit intomasterfrom
Conversation
980d5d8 to
15227a3
Compare
This new function allows attaching a callback to a request, such that when it is sent through a hyper client connection, and any 1xx informational responses are received, they are passed to the callback.
15227a3 to
027d6af
Compare
GlenDC
added a commit
to plabayo/rama
that referenced
this pull request
Feb 20, 2025
- ext: add ext::on_informational() callback extension (<hyperium/hyper#3818>) (<hyperium/hyper@8ce1fcf>, closes <hyperium/hyper#2565>) - server: add http1::Builder::ignore_invalid_headers(bool) option (<hyperium/hyper#3824>) (<hyperium/hyper@3817a79>) - server: - start http1 header read timeout when conn is idle (<hyperium/hyper#3828>) (<hyperium/hyper@10b09ff>, closes <hyperium/hyper#3780>, <hyperium/hyper#3781>) - change max_local_error_reset_streams function to &mut self (#3820) (e981a91e) - http2::Builder::max_local_error_reset_streams() now takes &mut self and returns &mut Self. In practice, this shouldn't break almost anyone. It was the wrong receiver and return types. (<hyperium/hyper@e981a91>) Co-authored-by: Sean McArthur <[email protected]> Co-authored-by: Finn Bear <[email protected]> Co-authored-by: tottoto <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This new function allows attaching a callback to a request, such that when it is sent through a hyper client connection, and any 1xx informational responses are received, they are passed to the callback.
Closes #2565
This takes the unstable client informational feature (introduced in #2594, tracking issue in #2565), and promotes it to a stable API. The way it works is largely the same: a user can embed a callback in an extension in a request, and if present, it is called with each 1xx response parsed for that request.
As long as it was working in an unstable manor for curl, we didn't really discuss further if it is particularly rusty. I welcome feedback to that effect.
Alternatives
ResponseFutureinstead. Some of the downsides I feel with that design are:ResponseFutureinto animpl Futureordyn Future(orasync fn) slightly higher up loses the ability to call those methods, or expose that functionality to users. For instance, composition in atowerstack.