Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream, doc: resume a stream after pipe() and unpipe() #13329

Closed
wants to merge 1 commit into from

Conversation

mcollina
Copy link
Member

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

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
@mcollina mcollina added doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels May 31, 2017
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem. labels May 31, 2017
@mcollina
Copy link
Member Author

cc @nodejs/streams @dmail @jasnell

@dmail
Copy link

dmail commented May 31, 2017

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
Copy link

@dmail dmail May 31, 2017

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)

Copy link
Member

@Trott Trott left a 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

@mcollina
Copy link
Member Author

mcollina commented Jun 5, 2017

Landed as 0b432e0 with @dmail nits.

@mcollina mcollina closed this Jun 5, 2017
mcollina added a commit that referenced this pull request Jun 5, 2017
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
PR-URL: #13329
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@mcollina mcollina deleted the fix-1041 branch June 5, 2017 07:21
jasnell pushed a commit that referenced this pull request Jun 5, 2017
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
PR-URL: #13329
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@jasnell jasnell mentioned this pull request Jun 5, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
MylesBorins pushed a commit that referenced this pull request Jul 17, 2017
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
PR-URL: #13329
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@MylesBorins
Copy link
Contributor

I've landed this in v6.x-staging. Let me know if it should be backed out

@mcollina
Copy link
Member Author

@MylesBorins this is ok to be backported.

@MylesBorins MylesBorins mentioned this pull request Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants