You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If both foo and bar are successfully read, the stream produces three buffers (contents of foo, contents of bar, and extra). If, for example, bar can't be read, the stream produces one buffer (contents of foo). Wouldn't it make more sense for the stream to produce (contents of foo, and extra) in that case?
The text was updated successfully, but these errors were encountered:
vqvu
changed the title
Concat with streams containing errors
Readables that close without an 'end' event does not end.
Apr 14, 2016
This isn't a concat thing. The fs.createReadStream will close itself when it encounters an error. This means emitting closewithout emitting end. We weren't listening to the close event, so the wrapper stream thought that the stream had never ended. That's why you didn't see the data from extra. It was waiting for the original foo/bar streams to end and they never did.
I take back what I said above. In the case where you try to open an non-existent file, you don't end getting a close at all. You just get a single ENOENT error. close only fires if the file was successfully opened but there was an error reading from it. Same class of bug though.
Consider the following code:
If both
foo
andbar
are successfully read, the stream produces three buffers (contents offoo
, contents ofbar
, andextra
). If, for example,bar
can't be read, the stream produces one buffer (contents offoo
). Wouldn't it make more sense for the stream to produce (contents offoo
, andextra
) in that case?The text was updated successfully, but these errors were encountered: