Hello, 2009/9/17 Matt Perry <m...@unshift.net>: > Make sure you're using the @inlineCallbacks decorator and the yield > statement referenced previously. Without those you're just adding several > callbacks to the same Deferred; with them, the function will wait until the > Deferred fires before continuing. > > def logRequest(self, *arg, **kw): > obj = copy.deepcopy(kw['obj']) > > d = self.db.runInteraction(obj.first) > > d.addCallback(self.db.runInteraction, obj.second, param1, param2) > d.addErrback(log.err) > > d.addCallback(self.db.runInteraction, obj.third) > d.addErrback(log.err)
I don't understand your explanation. When a callback returns a Deferred itself, the main Deferred object waits for its completion before continuing. This is IMO the best feature of Deferreds! I often write code like the function above, so I would like to understand why it does not work in this case. -- Amaury Forgeot d'Arc _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python