Open Sintendo opened 7 years ago
At first glance, it looks like the problem is in pipe(_().batch(1000))
. The only Highland stream that you can pipe to is the one that is returned by _()
or _.pipeline(...)
. When you call batch
, it returns a new stream that is read-only, so you can't pipe to that stream.
It's pretty rare that you'll need to use _()
at all. In this case, since readStream
is already a Highland stream, you can call batch
on it directly.
readStream
.batch(1000)
.pipe(writer);
If readStream
is a Node stream (since you mentioned HTTP streaming), you can create a Highland stream of out it using the Highland stream constructor.
_(readStream)
.batch(1000)
.pipe(writer);
I don't know why the code you showed works when you add the dummy transform, but it only works by coincidence.
We're dealing with an issue where piping streams through a highland batched stream causes it to halt. The actual code involves streaming data from HTTP, but I think I've managed to narrow it down to the following code.
This will cause the application to exit:
Strangely, adding the dummy transform before the batching causes it to flow properly:
Am I missing something?