-
-
Notifications
You must be signed in to change notification settings - Fork 396
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
Expose RecvStream::poll_read & poll_read_chunk #1784
Conversation
Now for this one, the |
In my use case, I'm thinking of using |
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.
I figured that if it might result in improved read performance, that might be desirable to expose too.
This is speculative. I'd prefer to avoid further complicating our API without a concrete use case that benefits, particularly as using poll_read_buf
correctly is itself complex. For example, your use case would need to handle consuming any number of chunks before reaching the desired total length, and you'd then have to either deal with having non-contiguous data in whatever downstream processing you do, or copy everything into a single buffer, at best duplicating the logic already provided by poll_read
.
Fair enough. In my understanding, the potential benefit was from the unordered read, even if you have to copy the chunks into a separate buffer, in the same way the |
(Needs a rebase. Would be nice if you can squash the commits here.) |
a227849
to
6341fd6
Compare
Closes #1782