[Web-SIG] Write buffering (was Re: WSGI uses)
Phillip J. Eby
pje at telecommunity.com
Fri Aug 20 19:21:05 CEST 2004
At 09:55 AM 8/20/04 -0700, tony at lownds.com wrote:
> > Still, your comments have illustrated to me that there does need to be
> > better definition of how flushing is expected to occur
>
>Thanks for deciphering those comments. This is what I was hoping for.
>
> >... the application would need
> > to
> > have a way to say, "no, really, please send it *now*."
> >
>
>Are you considering requiring start_response() return an object with
>.write() and .flush() methods?
No, I'm suggesting that write() should be guaranteed to either:
1) Flush all output before returning, or
2) Put data in a buffer that will be emptied by another thread or by the
operating system
To be a conforming implementation, a server/gateway must do one or the
other. The same rules should apply for data yielded by a returned
iterator, i.e. the data must be sent or buffered for continuous sending
before the iterator's next() method is called again.
More information about the Web-SIG
mailing list