It does buffer but it doesn't have to - it could easily be modified to 
instead push back by returning false on write(); this is functionality 
we've considered but haven't yet needed.

We need the pipe() implementation because the one in node stream appears to 
be broken - tests consistently fail if we comment ours out and inherit from 
stream. No idea what's going on, but node streams are known to have an 
unfortunate number of issues - 
e.g. https://github.com/joyent/node/pull/1040, 
https://github.com/joyent/node/pull/337, 
https://github.com/joyent/node/issues/777. So it's in there because it has 
to be for now - I'd drop it if I could.

Also, we have to turn strings into buffers to adhere to the stream contract 
- it's not "messing with the data". ReadStreams emit *buffers* unless an 
encoding is set, and Pipe fully implements this. (see 
http://nodejs.org/docs/latest/api/streams.html#stream.setEncoding) I'm 
definitely not saying it can't be improved, but it's a pretty battle-tested 
implementation - I had to rewrite it like four times to get it where it is.

-- 
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

Reply via email to