Closed jean-airoldie closed 6 months ago
Now for this one, the poll_read_chunk
is not part of AsyncRead
, so technically this would force you to support that new method, but I figured that if it might result in improved read performance, that might be desirable to expose too.
In my use case, I'm thinking of using poll_read
to read the size prefix, followed by poll_read_chunk
to read the actual message, for instance.
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.
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 read_to_end
method is implemented.
(Needs a rebase. Would be nice if you can squash the commits here.)
Closes #1782