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
Make hickory_proto::h3::H3ClientStream
Clonable
#2182
Conversation
What's the use case exactly? Not sure why we need/want to add a layer of locking here? In general I feel like the rest of the project uses channels to communicate with the task where the connection is held, rather than using locks. |
This allows On the other hand, a better approach is to separate the |
Unless you have benchmarked this to show what the effect on performance is, I don't think we should merge this in its current form. |
I'm not sure I understand what benefits you're suggesting here -- it definitely isn't an answer to my question about "use cases" -- which are by definition higher level. |
I will add test cases at some point in the future to compare the performance differences before and after. |
816dfc3
to
e088e09
Compare
I rewrote the code, separating the I have written test code to compare the performance of the code before and after the modifications. I found that the performance difference between before and after the modification is minimal and can be disregarded. Test Code:
Test Result(ms): |
You still haven't answered my question about use cases. |
In Section 3.3 "Connection Reuse" of RFC9114 (HTTP/3), it is explained that HTTP/3 connections allow for reuse to send multiple requests simultaneously. The
This prevents This modification make |
FWIW, http/2 has similar semantics, and we do have that clonable, so it seems reasonable to me to make h3 clonable as well: https://docs.rs/hickory-proto/latest/hickory_proto/h2/struct.HttpsClientStream.html I'd be inclined to approve this based on that, @djc |
That's fair, I guess. |
298c55f
to
d948dd9
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.
Given the discussion, I think this looks good. Could you rebase and fix the rustfmt issue? and then I can merge, @0xffffharry .
d948dd9
to
fef3a36
Compare
Done. @bluejekyll |
make
hickory_proto::h3::H3ClientStream
Clonable. This can reusehickory_proto::h3::H3ClientStream
.