Skip to content

splittable RequestStream #97

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

Merged
merged 1 commit into from
Jul 6, 2022
Merged

Conversation

yu-re-ka
Copy link

@yu-re-ka yu-re-ka commented Jun 18, 2022

#83

@yu-re-ka yu-re-ka marked this pull request as draft June 18, 2022 14:55
h3/src/quic.rs Outdated
@@ -32,7 +32,7 @@ impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
/// Trait representing a QUIC connection.
pub trait Connection<B: Buf> {
/// The type produced by `poll_accept_bidi()`
type BidiStream: SendStream<B> + RecvStream;
type BidiStream: BidiStream<B>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we keep the previous bounds, then implementors aren't required to provide splittable streams, just send and receive. If they implement BidiStream, as an opt-in, then the streams can be splittable.

But by not requiring it, we allow QUIC implementations that don't have an internal cheap way to split.

@yu-re-ka
Copy link
Author

I redesigned the split mechanism with that use case in mind, please have another look

@yu-re-ka yu-re-ka changed the title [WIP] splittable RequestStream splittable RequestStream Jun 20, 2022
@yu-re-ka yu-re-ka requested a review from seanmonstar June 20, 2022 23:14
@yu-re-ka yu-re-ka marked this pull request as ready for review June 20, 2022 23:14
stream: S,
bufs: BufList<Bytes>,
decoder: FrameDecoder,
remaining_data: usize,
/// Set to true when `stream` reaches the end.
is_eos: bool,
_phantom_buffer: PhantomData<B>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this marker required? How come? I imagine probably yes, but I'm struggling to catch exactly where/why...

Copy link
Author

@yu-re-ka yu-re-ka Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impl<S, B> FrameStream<S, B>
where
    S: BidiStream<B>,
    B: Buf,
{

If FrameStream doesn't have the B parameter, this gives an error that B is unconstrained...
But we need the B parameter because of BidiStream.

Copy link
Author

@yu-re-ka yu-re-ka Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#94 would remove the need for PhantomData markers everywhere

@yu-re-ka yu-re-ka requested a review from seanmonstar June 29, 2022 20:46
@seanmonstar seanmonstar merged commit 3e2c9d1 into hyperium:master Jul 6, 2022
@yu-re-ka yu-re-ka deleted the master5 branch July 6, 2022 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants