[Twisted-Python] Re: Teach Me Twisted Redux

Andrew Francis andrewfr_ice at yahoo.com
Thu Mar 20 17:24:21 EDT 2008

Hi Folks:

>  Clearly, the issues Twisted addresses are
non->trivial requiring an appreciation of the problem
>space before considering Twisted as a solution (you
>gotta know there's a question before someone tells
> the  answer)... unfortunately, the barrier to
>Twisted entry at that point makes most walk away.
>I've seen lots of threads concluding, simply,
>that twisted looked interesting but was simply too
>dense to even get started with... so, they go ahead
>and roll their own solution,  inevitably identifying
>the issues which form heart of the twisted  
>architecture, but being too far along to refactor. 
>And away we go.

I have barely scratched the surface of Twisted - some
of my experiences and suggestions:

1) I found that Abe Fettig's book was a set of good
training wheels. Not as good as say, Richard Steven's
"UNIX Network Programming" that really saved my bacon
when I was first learning socket programming. However
Fettig's book is good in the sense that I can find a
concrete example (HTTP RequestHandler), modify it a
bit and it does something useful. Gets me going while
I learn. Newbies need to build confidence with quick

Now I go to Twisted documentation that makes far more
sense as I need much more technical detail about what
Twisted is doing.

If I had to alter Twisted documentation, I would make
much of the stuff do concrete things, like get a web

Perhaps I would, through surveys, pick the ten most
common things new developers want to do, and show

2) Pictures. Both Twisted documentation and Fettig's
book lack pictures. 

When I was looking for a bug involving a Twisted call
that never fired the callback, I took notes, peppered
Twisted with logging statements, used a debugger and
asked questions, lots of questions. The resulting
control flow picture was sufficiently different from
what I had in mind.

That said, I would be tempted to do a simple client
example and server example and illustrate the control
flow, carefully matching the drawings with the
illustrations. I know this is tough. 


Perhaps this is closely related with common examples,
but show common idioms. For example, how to call a
database or a web server from a request handler. Or
scheduling work with reactor.callLater or Tasks.


Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

More information about the Twisted-Python mailing list