[Web-SIG] WSGI2: write callable?

Robert Collins robertc at robertcollins.net
Fri Sep 26 23:05:54 CEST 2014


On 27 September 2014 08:21, Benoit Chesneau <bchesneau at gmail.com> wrote:
>
>
> On Fri, Sep 26, 2014 at 5:32 AM, 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.
>>
>> -Rob
>>
>
> What would be the advantage of using a queue compared to simply write to the
> server? Internally the server can use queue, but why the client should know
> it? What is the reasoning behind it?

The point is to remove the complexity of having both an iterator over
content *and* a write method.

Thats really complex for server [and middleware] writers. So the
interface to send bytes to the container would just be 'yield them'.
(Or return a fully populated list).

So the point about the Queue is that to support PEP-3333 we either
need to retain the write() callable, or we need an adapter that can
expose on its upper side the iterator we want, and on the lower side
accept *either* an iterator  *or* use of  write() method - I think
you'll find thats quite hard to write without a Queue or similar
construct.

-Rob

-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud


More information about the Web-SIG mailing list