[Twisted-Python] How to safely stop a chain of deferreds

Itamar Turner-Trauring itamar at itamarst.org
Tue Jun 28 10:10:14 EDT 2011


On Tue, 2011-06-28 at 15:30 +0200, tomw wrote:

> I tried to
> cancel the first deferred, hoping that the cancel event will be
> forwarded to the next deferred in the chain or at least invoke an
> errback, but for some reason it does not work and the deferreds seem to
> run forever. Any ideas on how to solve this issue?

Unless you registered a cancellation function for the Deferreds, the
best cancelling one can do is not pass you the results. So you'll need
to register a canceller for the Deferred that is hooked up to the result
of the original task (and any new Deferreds created along the chain).




More information about the Twisted-Python mailing list