forked from pkolaczk/latte
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chunk stream properly if underlying stream always ready
The previous chunking stream adapter had a problem that if the underlying stream never went into Poll::Pending state, it looped forever. It never yielded back to the executor, the time was not properly advanced, and the chunks were not produced. This commit fixes it by limiting the number of items requested from the underlying stream in a single poll_next, and letting the runtime poll again immediately if there exist items ready to pick. This way we give the async runtime a chance to execute a different future or to do other important stuff. (cherry picked from commit 70edd92)
- Loading branch information
1 parent
cae8e19
commit f45bca7
Showing
1 changed file
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters