[Twisted-Python] deferred proposed update

Tommi Virtanen tv at tv.debian.net
Tue Jan 20 04:30:09 EST 2004

Fabrice Coudert wrote:
> I 'd like to add a pre-processing and post-processing callback in a 
> deferred callback list. I did somthing like this :
 > my_defer = getADeferredForSomething()
 > new_defer = defer.Deferred()
 > new_defer.addCallback(preprocessing)
 > new_defer.chainDeferred(my_defer)
 > new_defer.addCallback(postprocessing)
 > my_defer = new_defer

You are using Deferreds incorrectly. For example, nothing here
makes new_defer ever trigger.

You haven't stated clearly what you want to do, but I don't see
why you aren't just doing this:

d = getADeferredForSomething()

More information about the Twisted-Python mailing list