-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
stream, doc: resume a stream after pipe() and unpipe() #13329
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Clarifies the behavior of streams when _readableState.flowing is false. resume() must be called explicitly for the 'data' event to be emitted again. Fixes: nodejs#1041
I like that, especially having a code example alongside the doc. |
const pass = new PassThrough(); | ||
const writable = new Writable(); | ||
|
||
pass.pipe(writable); pass.unpipe(writable); // flowing is now false |
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 think that would be better to keep an instruction per line
pass.pipe(writable);
pass.unpipe(writable);
// flowing is now false
(I had written those on the same line back in 2015 but that was a bad idea)
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.
LGTM with code format change suggested by @dmail
I've landed this in v6.x-staging. Let me know if it should be backed out |
@MylesBorins this is ok to be backported. |
Clarifies the behavior of streams when _readableState.flowing is
false. resume() must be called explicitly for the 'data' event to
be emitted again.
Fixes: #1041
Checklist
Affected core subsystem(s)
doc, stream