[Twisted-Python] Deferred documentation rewrite

Dave Britton dave at davebritton.com
Mon Aug 3 17:08:36 MDT 2009


----- Original Message -----
From: "Edward Z. Yang" <ezyang at MIT.EDU>
To: "Twisted general discussion" <twisted-python at twistedmatrix.com>
Sent: Monday, August 03, 2009 6:00 PM
Subject: Re: [Twisted-Python] Deferred documentation rewrite
================
I like the side-by-side regular and twisted versions,  that's helpful.
You are approaching the complicated stuff toward the end - please don't stop
there.
Show some more examples of more intricate cases of side-by-side logic,
eg how to use deferreds for this if all foo's are asynchronous:
x=foo1(y)
if x > 0:
    z=foo2(x)
    y = foo3(z)
else:
    z=foo4(x,y)
alldone=foo5(z)
# now add error handling for all the deferreds
# how would I debug things if foo3 had an unanticipated error?
================
My latest real question for the docs to answer is,
Are these different?
== example 1 ====
d=asynchronousprocess()
d.addCallback(b)
d.addCallback(c)
d.addErrback(errbc)
=== example 2 ====
d=asynchronousprocess().addCallback(b).d.addCallback(c).d.addErrback(errd)
=============
Why or why not? When might one use one form over the other?
-Dave





More information about the Twisted-Python mailing list