[Twisted-Python] inlineCallbacks cascading cancelling and more
jaroslaw.fedewicz at gmail.com
Tue Aug 17 03:46:58 EDT 2010
On Aug 17, 2010, at 8:49 AM, Sergey Magafurov wrote:
> ... lots of text skipped ...
You are currently considering your task from the viewpoint “let's make a callback chain for the perfect workflow and alter this chain in case of anything going wrong.” I think the flaw with this approach is that you are trying to make your “ideal” flow work at all in situations where it would, in fact, fail for the most of the time.
Instead of this, you could try to reconsider the task from the viewpoint of “Let's not add any further callbacks until this is absolutely necessary”. For me, this approach rather works. Moreover, you have the means to do it — a callback can return a Deferred, and so on.
Hope that helps.
More information about the Twisted-Python