[Twisted-Python] Adding callback to a Deferred that's already running?

Steve Freitas sflist at ihonk.com
Thu Aug 26 03:12:51 EDT 2004

> This wasn't spectacularly obvious to me the first time either, but I
> think it's covered somewhere in the deferred execution howto; in your
> callback/errback, return a new deferred and the processing of the
> deferred chain will pause until that new deferred fires.  Here's an
> example of code that does that...

Thanks for your reply, Mike! I don't thoroughly understand your code yet, but 
I'm workin' on it. One of the things I don't like about the examples is that 
they don't demonstrate a conditional addition of a callback.

One of the things I did try was returning a new Deferred from step2(), but it 
didn't work, and I'm not sure why. I'm checking out defer.py now to try to 
figure out how it works...


More information about the Twisted-Python mailing list