On Tue, Feb 7, 2012 at 03:09, Bert Belder <bertbel...@gmail.com> wrote:
> If people really like the old situation
> we could make the old behavior optional, e.g.
> `stream.pause(allowData=false)`.

No one wants the old behavior.  It's only confusing.

We do need to put some kind of limit on how much will be buffered,
however.  It's too easy to pause a request, then fail to resume it in
a reasonable time, and have it take up all the memory.  This won't
happen very often when dealing with TCP streams, since they'll push
back on the wire, but if we make this a general guarantee on userland
streams, then it needs to be implemented in Stream.stream, and take an
argument for how many bytes to buffer.

stream.pause(maxBuffer=1024) or something.  Then keep an array of
chunks (like Koichi did for http request streams), and if the total
length goes over that number, then start emitting data events.  This
will impact performance a bit when it happens, but since it's a
relatively rare situation, I think that's probably fine.

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

Reply via email to