[Web-SIG] Write buffering (was Re: WSGI uses)

Ian Bicking ianb at colorstudy.com
Fri Aug 20 18:13:21 CEST 2004


Phillip J. Eby wrote:
> Still, your comments have illustrated to me that there does need to be 
> better definition of how flushing is expected to occur, although there 
> is only one use case I can think of for it.  Specifically, the only time 
> an application needs to ensure that all its pending output has been sent 
> to the client, is when it is about to perform some lengthy calculation 
> and is using "server push" to display a "please wait" screen before 
> returning the real result.  In this case, if I/O is single-threaded 
> (i.e. only happens when write() calls are made), and write() isn't 
> guaranteed to be flushed (e.g. it's buffered and sent in blocks), then 
> the application would need to have a way to say, "no, really, please 
> send it *now*."

I some environments (e.g., CGI) I don't believe there's any way to 
ensure that the data gets sent immediately.  The buffering is rather 
opaque in those cases.  So all we can do is try, we can't really 
guarantee that data will be sent.

-- 
Ian Bicking  /  ianb at colorstudy.com  /  http://blog.ianbicking.org


More information about the Web-SIG mailing list