I'm not only updating the code to work with recent Nginx versions (after
2 years) but, above all, I'm cleaning up the code, removing stuff not
strictly required and hard to maintain.
I have already removed support to multiple Python subinterpreters, and
now I'm going to remove the async extensions I wrote (there will only
one very simple API, for applications using greenlets); finally I would
like to remove support to the write callable.
The problem, to put it simple, is that the write callable *can not* be
implemented in an asynchronous web server like Nginx.
I have two implementations:
* the first (not the default), simply keeps a buffer.
This is explicitly forbidden by WSGI.
* the second puts the Nginx connection socket in synchronous mode;
it works but it is something that *should not* be done.
So, I was thinking: what about a WSGI middleware that, using greenlets,
expose to the application a write callable with the correct code flow?
> In this period I'm upgrading my WSGI implementation for Nginx:
> http://hg.mperillo.ath.cx/nginx/ngx_http_wsgi_module/ > [...]
> So, I was thinking: what about a WSGI middleware that, using greenlets,
> expose to the application a write callable with the correct code flow?
> Here is a very first draft:
> http://pastebin.com/4k1Ep4dH >
> It should work with every standard WSGI implementation.