[Web-SIG] WSGI 2.0

Phillip J. Eby pje at telecommunity.com
Sat Oct 6 16:36:17 CEST 2007

At 11:04 AM 10/6/2007 +0200, Manlio Perillo wrote:
>As an example, the WSGI write callable cannot be implemented in a
>conforming way in Nginx.

...unless you use a separate thread or process.

> > If we were going to try to implement an asynchronous WSGI, what we would
> > *really* need to do is discard the app_iter and make write() the
> > standard way of sending the body.  This would let us implement a CPS
> > (continuation-passing style) API.
>But isn't this possible just using a generator?

No, because using a generator means there needs to be a separate 
callback to force the generator to be reiterated.  Hence the 
complexity of adding an async API to the existing WSGI model.

> > We would also have to change the
> > input stream so that instead of reading from it, we instead passed it
> > functions to be called when input was available,
>Another possible solution is that reading from input is allowed to raise
>an EAGAIN exception, like in the previous example.

Which is *way* more complex than the CPS approach.  If we're going to 
make it *harder* to write applications, there's no point to having a 
WSGI 2.0, since 1.0 is already hard enough to implement.  :)

More information about the Web-SIG mailing list