[Web-SIG] WSGI2: write callable?

Benoit Chesneau bchesneau at gmail.com
Fri Sep 26 22:26:04 CEST 2014


On Fri, Sep 26, 2014 at 9:58 PM, PJ Eby <pje at telecommunity.com> wrote:

> On Thu, Sep 25, 2014 at 11:32 PM, Robert Collins
> <robertc at robertcollins.net> wrote:
> > So I propose we drop the write callable, and include a queue based
> > implementation in the adapter for PEP-3333 code.
>
> If you're dropping write(), then you might as well drop
> start_response() altogether, and replace it with returning a (status,
> headers, body-iterator) tuple, as in wsgi_lite (
> https://github.com/pjeby/wsgi_lite ) or as found in other languages'
> versions of WSGI.  (start_response+write was only ever needed in order
> to support legacy apps, so other languages never bothered.)
>
> wsgi_lite has a couple of other protocol extensions, namely the
> 'wsgi_lite.closing' environment key, flagging callables' supported
> WSGI version (for transparent interop), and the argument binding
> protocol, but for the most part these are orthogonal to the calling
> schema.  I would suggest, however, that the calling protocol be
> flagged in some way to allow easier interop.
>

I quite like the idea of always returning an iterator for the body it would
simplify the code a lot...

About returning the status and other thing, I quite agree, but imo we also
need to return an extra parameter where the application or the middleware
could maintain a state or something like it. Thoughts?

- benoit


> _______________________________________________
> Web-SIG mailing list
> Web-SIG at python.org
> Web SIG: http://www.python.org/sigs/web-sig
> Unsubscribe:
> https://mail.python.org/mailman/options/web-sig/bchesneau%40gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/web-sig/attachments/20140926/fd223255/attachment.html>


More information about the Web-SIG mailing list