[Twisted-Python] Multiple deferreds that depend on each other

Landreville landreville at deadtreepages.com
Tue Nov 17 10:35:09 EST 2009

I know people ask about deferreds all the time (and i've read through a
bunch of those questions), but there is still one thing I don't quite grasp.

If I want to do a number of actions in a row that each return a deferred but
depend on eachother, do I need to nest those callbacks?

Ie if i want to:
1. Call database function using adbabi
2. Call xmlrpc method using result from 1
3. Call database using result from 2

Would I just put 2 inside the callback for 1 and then put 3 inside the
callback for 2?

How would I do that in one function? All the examples I have seen have a
function calling one method returning a deferred and then placing the logic
(doing something with the result) in the callback, but do not deal with
multiple deferreds that depend on each other.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20091117/3be69013/attachment.htm 

More information about the Twisted-Python mailing list