[Web-SIG] some questions about the write callable

Manlio Perillo manlio_perillo at libero.it
Mon Oct 15 23:25:06 CEST 2007


Manlio Perillo ha scritto:
> Hi.
> 
> The only feature that remains to implement for nginx mod_wsgi is the 
> write callable.
> 
> The WSGI spec says:
> """In other words, before write() returns, it must guarantee that the 
> passed-in string was either completely sent to the client, or that it is 
> buffered for transmission while the application proceeds onward."""
> 
> 
> With Nginx it can happen that the passed-in string cannot be completely 
> sent to the client, since the socket can returns an EAGAIN.
> 
> In this case Nginx will buffer the data and it will send the buffer to 
> the client when the socket is ready.
> 

A correction.
Nginx will not buffer the data, it will ignore successive write requests.

The buffering must be done by the application.

For the moment I will raise an exception when the data cannot be 
completely written to the client (IMHO this does not forbidden the WSGI 
spec, but, of course, it is not very useful).




Regards  Manlio Perillo


More information about the Web-SIG mailing list