Uh oh!
There was an error while loading. Please reload this page.
stream: don't destroy final readable stream in pipeline - #32110
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
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.
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.
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)}) |
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
@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! |
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
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes