[Twisted-Python] Re: Memory size of Deferreds

Martin Geisler mg at daimi.au.dk
Wed May 21 07:03:30 EDT 2008


Nicola Larosa <nico at teknico.net> writes:

> Martin Geisler wrote:
>> it will only run up to max function applications in parallel. I will
>> experiment with it, and if it works well, then it would be cool to
>> have a class like this in Twisted.
>
> Something like DeferredQueue? :-)
>
> http://twistedmatrix.com/trac/browser/trunk/twisted/internet/defer.py#L950

Hehe, I can see that this does something that looks very similar :-)

I think a DeferredQueue is a bit more general than my code -- I think
you need some code in addition to a DeferredQueue in order to obtain
what I want: limited parallelism.

In particular, I guess you need to catch the QueueUnderflow exceptions
and then somehow know when it is time to call get() again.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.





More information about the Twisted-Python mailing list