[nodejs] Re: What's a good way for a transform stream to pipe from one source into multiple destinations with different data per destination?

2013-09-10 Thread Conrad Pankoff
It's funny you should bring this up, because I just wrote this[1] last night. It sounds like it does exactly what you want. [1]: https://github.com/deoxxa/fork-stream On Tuesday, 10 September 2013 04:55:48 UTC+10, Tyler Neylon wrote: > > You can call pipe multiple times on a single readable stre

[nodejs] Re: What's a good way for a transform stream to pipe from one source into multiple destinations with different data per destination?

2013-09-10 Thread Tyler Neylon
Thanks, Floby. I think your suggestion of a balancing multi-output stream is a good idea. On Tuesday, September 10, 2013 12:07:51 AM UTC-7, Floby wrote: > > I'd go with a different solution where this is not the transform stream > doing the load balancing... > > The transform stream transforms.

[nodejs] Re: What's a good way for a transform stream to pipe from one source into multiple destinations with different data per destination?

2013-09-10 Thread greelgorke
tl;dr; no, but longer version: you should first consider that the stdio and stderr are 2 different streams. the './somebinary' in your cli example would write to one or the other stream exclusively. so internaly your transform stream should have additional readable stream(s) array and implem

[nodejs] Re: What's a good way for a transform stream to pipe from one source into multiple destinations with different data per destination?

2013-09-10 Thread Floby
I'd go with a different solution where this is not the transform stream doing the load balancing... The transform stream transforms. you need another stream to balance. Source -> transform -> balance -> (dest1, dest2) You'd need to override the pipe method on your balance stream, which might b