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

Jason Rennie jrennie at gmail.com
Wed Jun 29 15:54:36 EDT 2011


On Tue, Jun 28, 2011 at 9:30 AM, tomw <tomw at ubilix.com> wrote:

> in a GUI application I'm using quite a comprehensive chain of deferreds
> and I'm running the mainloop from the glib2reactor. At a certain point
> of my application I need to terminate the entire chain of deferreds to
> make sure that no more data is loaded and processed.


Have you tried setting up appropriate callback functions and raising an
Exception at the point where the callback chain should be terminated?  Note
that each errback should return the provided failure so that execution
doesn't switch back to the callback side.  See "Visual Explanation" in this
document:

http://twistedmatrix.com/documents/current/core/howto/defer.html

Cheers,

Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20110629/a20700b8/attachment.htm 


More information about the Twisted-Python mailing list