if you don't read anything from your transform stream, the internal
buffer is getting full and the pipe chains throttles down, no reads
and writes until you get something out of the buffer.
Thank you, this explains why Transform seems lazy.
In my opinion your transform stream should be a Writable, that just
emits 'messages' (since you do nothing really with the data gone out
the pipe) OR you should create a wirtable stream that consumes results
from your transform AND put your transform into objectMode, you you
can this.push full messages instead of chunks.
This is just a demo code. In my program, the transform will pipe to
sockets that newly connected to my server AND I have a log-like object
always receives 'message' that transform emits.
That is, both transformed data and raw data is needed. And that's why I
have this strange use of Transform.
I could have inserted another Writable before Transform so that I can
partition these two different jobs into different objects. But I was too
lazy to do that.
Anyway, 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.