[Twisted-Python] addCallbacks issue

Jonathan Simms slyphon at twistedmatrix.com
Sun Apr 18 03:19:38 EDT 2004

I think that:


is the more common idiom because it avoids the double-helix nature of
deferred handling, opting instead for a single node-to-node chain of
handling, which is less complex conceptually.


> Another way of approaching the concept might be to say that each stage
> in the chain has to deal with the errors in the chain before it - that
> is, if you do:
>       d.addCallbacks(cb, eb)
> then eb needs to handle any errors that arise from the data source, 
> while if you do:
>       d.addCallback(cb)
>       d.addErrback(eb)
> then eb needs to handle any errors that arise from the data source,
> any errors that arise from cb.

I think that this chunk is the important concept to document. This
explanation in addition to the imperitave example given by Stephen would
ensure that this concept is documented and explained sufficiently. In
fact, i'd never thought to consider deferreds as a try/except/else
statement. very useful concept!

It's funny, because when i read the original posting to this thread, I
had the same confusion. "Waitasec, that errback /should/ get called!"

this thread has helped to elucidate a subtle and important point about

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20040418/4caf7871/attachment.pgp 

More information about the Twisted-Python mailing list