Closed arantes555 closed 5 years ago
This is by design, the multipipe itself needs to be consumed for data to flow internally. You can also fix your example by ending it with:
const m = multipipe(input, outputStream)
m.resume()
If you don't care about the return value of multipipe
and just want to use it for internal flow control, Stream#pipeline()
from node core is the right method.
Hi,
I'm running into an issue with all node versions >= 10.10.
The problem is that, sometimes (I cannot pinpoint exactly under which conditions), putting streams into multipipe seems to stop the flow, so streams are piped but no data is actually flowing.
As a test, you can run the following code:
On node < 10.10, you get a log of
1000000
, as is expected.On node >= 10.10, you get nothing, except if you uncomment the last line.
This unexpected behaviour is easy to workaround (just add a
.resume()
), but quite annoying... It seems linked to https://github.com/nodejs/node/pull/22209 and https://github.com/nodejs/node/pull/18994 .