I am trying to solve a Nodejs stream challenge. I have read the node documentation on streams multiple times, and implemented different attempts to solve the challenge. Trying with both duplex, transform, readable and writable :)
I have multiple HTTP readable streams, and the objective is to send data to a single pipeline, with backpressure working. I think this picture helps explain the challenge:
Update (13. september 2017). After reading the documentation again, I am implementing a custom written duplex stream.
This represents a great usecase for a duplex stream, combined with manuel flow control of the HTTP stream.
I have written a custom duplex stream, where the readable and writable part, is structured like this:
If you are interested in the specific code for the duplex stream, please send me a PM.
The code could look something like this (but it's pretty old, and could probably be simplified even more):