Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stream: always defer 'readable' with nextTick
Emit 'readable' always in the next tick, resulting in a single call to _read() per microtick. This removes the need for the user to implement buffering if they wanted to call this.push() multiple times in an asynchronous fashion, as this.push() triggers this._read() call. PR-URL: #17979 Fixes: #3203 Reviewed-By: James M Snell <email@example.com> Reviewed-By: Anna Henningsen <firstname.lastname@example.org> Reviewed-By: Benjamin Gruenbaum <email@example.com>
- Loading branch information
Showing with 263 additions and 57 deletions.
- +15 −0 doc/api/stream.md
- +14 −8 lib/_stream_readable.js
- +8 −4 test/parallel/test-net-end-close.js
- +12 −20 test/parallel/test-stream-pipe-await-drain-push-while-write.js
- +10 −7 test/parallel/test-stream-readable-emittedReadable.js
- +12 −11 test/parallel/test-stream-readable-needReadable.js
- +183 −0 test/parallel/test-stream-readable-object-multi-push-async.js
- +2 −1 test/parallel/test-stream-readable-reading-readingMore.js
- +7 −6 test/parallel/test-stream2-transform.js
Oops, something went wrong.