Have you tried just using asyncio.Queue? That would seem to have everything
you need. You can just have one task that sits in a loop like this:

    while True:
        work_item = yield from queue.get()
        <process work_item>


On Thu, May 1, 2014 at 11:13 AM, <[email protected]> wrote:

>
> Then can you at least point me to an example of how you use it?
>>
>> From the docs you pointed to I don't get a good idea of what it does or
>> what it's good for -- it almost seems like in Tulip you would just create a
>> Task for each thing you want to happen and that's that.
>>
>>
> Sure, JP Calderone has written up a pretty good example / explanation on
> stackoverflow [1].
> I'd like to build something like his second example using the
> DeferredQueue (which should behave very much like the asyncio.Queue) and
> the Cooperator, which takes a generator and processes deferred produced in
> the queue as soon as stuff gets added to it.
>
> [1]
> http://stackoverflow.com/questions/2861858/queue-remote-calls-to-a-python-twisted-perspective-broker
>



-- 
--Guido van Rossum (python.org/~guido)

Reply via email to