Skip to content
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

simplify traits #200

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft

simplify traits #200

wants to merge 21 commits into from

Conversation

Ruben2424
Copy link
Contributor

This is a not 100% working change to explore some of the proposed changes from #177.

@Ruben2424 Ruben2424 changed the title simplify traits quick and dirty simplify traits Jun 25, 2023
Copy link
Contributor

@FlorianUekermann FlorianUekermann left a comment

Choose a reason for hiding this comment

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

The poll merger looks good to me. Since we need to document expectations for different close scenarios anyway, it may make sense to handle the close type situation in this PR as well. I would recommend the enum proposal from #177 B2 (replace Error with Close enum).

In any case, I think the expectation that the quic implementation always emits a Close/Error via poll_incoming on termination should be documented.

Stream opening itself can't fail (only block), unless the connection is terminated. Therefore I think it would be good to remove the errors from poll_open_*. That removes any ambiguity how Closes are communicated (only via poll_incoming). I'm not even convinced returning an Option is necessary. Just Poll::Pending should be fine as well.

///
/// Returning `None` implies the connection is closing or closed.
fn poll_accept_bidi(
/// Poll the connection for incoming streams.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add: /// Returning an Err implies the connection is closing or closed.

@Ruben2424
Copy link
Contributor Author

Ruben2424 commented Jun 26, 2023

Thanks for the review.

I would recommend the enum proposal from #177 B2 (replace Error with Close enum).

I will continue to work on this and implement #177 B2.

I Think this are my next tasks:

@dongcarl
Copy link
Contributor

dongcarl commented Aug 8, 2023

@Ruben2424 Is this PR in a state where it's ready for review?

@Ruben2424
Copy link
Contributor Author

@Ruben2424 Is this PR in a state where it's ready for review?

@dongcarl you can review the changes if you want. But there is still some work left to improve the error types.
I probably have time to continue on this next week.

@Ruben2424
Copy link
Contributor Author

I think i will not continue on this as one big pr. Instead I probably will split them up into multiple smaller ones which are easier to review.

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.

None yet

3 participants