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

Make SendStream::finish synchronous #1840

Merged
merged 3 commits into from
May 3, 2024
Merged

Make SendStream::finish synchronous #1840

merged 3 commits into from
May 3, 2024

Conversation

Ralith
Copy link
Collaborator

@Ralith Ralith commented May 1, 2024

Followup to #1699. SendStream::finish as a future has proved to be a footgun, so this converts it into a synchronous method, delegating "wait until received" duties to SendStream::stopped. We expect that to rarely be required in real applications, though it does come up several times in our tests where we specifically want some data to be received before we drop a connection or take a time measurement.

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

Looks great!

Style suggestion: I like using the () suffix on method/function names in intra-doc links, and rustdoc copes with it. Maybe consider it?

quinn/src/send_stream.rs Outdated Show resolved Hide resolved
quinn/src/send_stream.rs Show resolved Hide resolved
Ralith added 3 commits May 3, 2024 11:45
`await`ing on this was error-prone and not very useful, since it gave
little insight into application state, and was redundant to `stopped`.
UnknownStream here corresponds to graceful stream shutdown, which is
not an error case.
@Ralith Ralith merged commit 0e9a196 into main May 3, 2024
8 checks passed
@Ralith Ralith deleted the synchronous-finish branch May 3, 2024 18:52
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