This repository has been archived by the owner on Apr 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stream: Simplify flowing, passive data listening
Closes #5860 In streams2, there is an "old mode" for compatibility. Once switched into this mode, there is no going back. With this change, there is a "flowing mode" and a "paused mode". If you add a data listener, then this will start the flow of data. However, hitting the `pause()` method will switch *back* into a non-flowing mode, where the `read()` method will pull data out. Every time `read()` returns a data chunk, it also emits a `data` event. In this way, a passive data listener can be added, and the stream passed off to some other reader, for use with progress bars and the like. There is no API change beyond this added flexibility.
- Loading branch information
Showing
11 changed files
with
433 additions
and
201 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
Oops, something went wrong.