Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
stream: don't destroy final readable stream in pipeline#32110
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
3d9f49b to 9cb4046Compare This comment has been minimized.
This comment has been minimized.
If the last stream in a pipeline is still usable/readable don't destroy it to allow further composition. Fixes: nodejs#32105
9cb4046 to 5fefa4fCompare This comment has been minimized.
This comment has been minimized.
nodejs-github-bot commented Mar 5, 2020
nodejs-github-bot commented Mar 5, 2020
mcollina left a comment
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
ronag commented Mar 6, 2020
@nodejs/streams |
MylesBorins commented Mar 6, 2020
CI LGTM (not signing off as I am not familliar with codebase). If no one else wants to volunteer I can help get this out in a release next week |
vweevers left a comment
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.
Good for composition. Might be surprising in some cases - e.g. when the user isn't aware that their last stream is a duplex, for example with gulp.dest() - so should be documented later on.
ronag commented Mar 7, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Why is it a I agree some documentation might be in order. |
vweevers commented Mar 7, 2020
@ronag Many gulp examples suggest that constvfs=require('vinyl-fs')// or gulpconst{ pipeline }=require('stream')constsrc=vfs.src('./index.js')constdest=vfs.dest('./dest')pipeline(src,dest,function(err){if(err)throwerr})And following that, you'd expect constsrc=vfs.src('./index.js')constdest1=vfs.dest('./dest1')constdest2=vfs.dest('./dest2')pipeline(src,dest1,dest2,function(err){if(err)throwerrassert.strictEqual(dest2.readable,true)}) |
ronag commented Mar 7, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I don't understand what that last example is supposed to do? Will |
vweevers commented Mar 7, 2020
Yes, they are duplex streams that pass through their input. In a nutshell, the snippet above copies I can't think of cases other than gulp though and I consider the above to be a flaw in its API design rather than a problem that node streams should address. |
vweevers commented Mar 7, 2020
I wanted to suggest a CITGM, which includes |
nodejs-github-bot commented Mar 7, 2020
nodejs-github-bot commented Mar 7, 2020
ronag commented Mar 8, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@vweevers You are a member of nodejs/streams but GitHub doesn't count your approval? How come? |
mcollina commented Mar 8, 2020
vweevers commented Mar 8, 2020
I don't have write access to this repo. @mcollina invited me to the streams wg in relation to |
mcollina commented Mar 8, 2020
You are welcome to chime in here @vweevers! |
If the last stream in a pipeline is still usable/readable don't destroy it to allow further composition. Fixes: #32105 PR-URL: #32110 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
ronag commented Mar 8, 2020
Landed in 4d93e10 |
If the last stream in a pipeline is still usable/readable don't destroy it to allow further composition. Fixes: #32105 Backport-PR-URL: #32111 PR-URL: #32110 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
If the last stream in a pipeline is still usable/readable
don't destroy it to allow further composition.
Fixes: #32105
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes