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 stream, like this:
>
> var reader = createReadableStream();
> reader.pipe(createWritableStream(1));
> reader.pipe(createWritableStream(2));
>
> which is cool. However, I am implementing a transform stream, and I'd like 
> to be able to do something like this:
>
> var transform = createTransformStream();
> reader.pipe(transform);
> transform.multipipe(1, writer1);  // NOT the usual pipe; args explained 
> below.
> transform.multipipe(2, writer2);
>
> where the transform stream is smart enough to slow down its input if 
> *either* writer1 or writer2 request to pause (i.e. return false on a call 
> to write()).
>
> The notation multipipe(n, <writer>) is meant to indicate that the two 
> writers receive different streams, unlike the usual behavior of pipe in the 
> first example. This is analogous to piping in bash where I have separate 
> output via both stderr and stdout, like this:
>
> $ cat afile | ./somebinary > outfile1 &> outfile2
>
> Is there a nice way to support this functionality in the current streams 
> interface?
>
> thanks!
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to