[Twisted-web] Is there a way to implement a deferred sequence?

Terry Jones terry at jon.es
Thu Apr 9 15:18:39 EDT 2009


>>>>> "Alexey" == twisted-web  <twisted-web at udmvt.ru> writes:

Hi Alexey

Alexey> I want a sequence which is Deferred with two callbacks: one as
Alexey> usual - for the whole result called at the end of the sequence,
Alexey> another - called for every element of the sequence (as they
Alexey> arrive).

I'm pretty sure I don't understand exactly what you want. Maybe you could
write it in pseudo-code, showing both how you'd call the thing you want and
what the code to implement it would look like, at least conceptually. I
can't promise to help, if you can be a bit more specific it might be easier
to be more helpful.

You might find something of worth in one of my Twisted mailing list
soliloquies, which starts here:

  http://www.twistedmatrix.com/pipermail/twisted-python/2008-June/017904.html

I have feeling that the code Esteve Fernandez and I came up with to tackle
that situation might be something like what you're after.

You may also like to think about whether you can use
twisted.internet.task.LoopingCall It's more flexible than it may appear at
first, and it also fits your pattern at least at a high-level description.

Terry



More information about the Twisted-web mailing list