[Twisted-Python] chainDeferred does not pass result

I was trying to chain two Deferreds together but there is a problem with chainDeferred(). If i add Deferred object b in the middle of the call chain of object a, the result is correctly passed on to the branched call chain of b but the call chain of a is broken because b.callback() does not return a result. Am i missing something or is this a bug ? The example below illustrates the problem. If you uncomment the line deferred_a.chainDeferred(deferred_b) you should see result: None Cheers, Lutz #---------------- from twisted.internet import defer, reactor def square(res): return res*res def on_result(res): print "result: ", res return res def on_error(err): print err return err deferred_a = defer.Deferred() deferred_b = defer.Deferred() deferred_a.addCallback(square) # deferred_a.chainDeferred(deferred_b) deferred_a.addCallbacks(on_result, on_error) reactor.callLater(0.0, deferred_a.callback, 3) reactor.callLater(1.0, reactor.stop) reactor.run() #---------------- -- Super-Aktion nur in der GMX Spieleflat: 10 Tage für 1 Euro. Über 180 Spiele downloaden: http://flat.games.gmx.de

On Thu, May 29, 2008 at 10:06 AM, "Lutz Pälike" <lutz_p@gmx.net> wrote:
It's not a bug, it's how chainDeferred is meant to work. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/

On Thu, May 29, 2008 at 10:06 AM, "Lutz Pälike" <lutz_p@gmx.net> wrote:
It's not a bug, it's how chainDeferred is meant to work. -- Christopher Armstrong International Man of Twistery http://radix.twistedmatrix.com/ http://twistedmatrix.com/ http://canonical.com/
participants (2)
-
"Lutz Pälike"
-
Christopher Armstrong