Part 22: The End
This concludes the introduction started here. You can find an index to the entire series here.
All Done
Whew! Thank you for sticking with me. When I started this series I didn’t realize it was going to be this long, or take this much time to make. But I have enjoyed creating it and hope you have enjoyed reading it.
Now that I have finished, I will look into the possibility of generating a PDF format. No promises, though.
I would like to conclude with a few suggestions on how to continue your Twisted education.
Further Reading
First, I would recommend reading the Twisted online documentation. Although it is much-maligned, I think it’s better than it is often given credit for.
If you want to use Twisted for web programming, then Jean-Paul Calderone has a well-regarded series called “Twisted Web in 60 Seconds“. I suspect it will take a little longer than that to read, though.
There is also a Twisted Book, which I can’t say much about as I haven’t read it.
But more important than any of those, I think, is to read the Twisted source code. Since that code is written by people who know Twisted very well, it is an excellent source of examples for how do to things the “Twisted Way”.
Suggested Exercises
- Port a synchronous program you wrote to Twisted.
- Write a new Twisted program from scratch.
- Pick a bug from the Twisted bug database and fix it. Submit a patch to the Twisted developers. Don’t forget to read about the process for making your contribution.
The End, Really
Happy Hacking!

Thank for your great work!!
I wanna translate in Japanese till the end as soon as possible.
If you plan to generate PDF files, `Sphinx` is a good choice, I think.
Although I’m a newbie of both Sphinx and git, this works well for now.
Please take a look at my repo on github.
https://github.com/skitazaki/twisted-intro-ja
Excellent! I’ve used Sphinx before, I’ll take a another look at it.
Dave,
This was an incredibly well-written and well-thought-out tutorial. This morning I decided that Twisted was the right tool for my job and I went about learning it and I came upon this series. 8 hours later, I’ve gone through each and every article and worked through all the examples; now I fully understand the different parts within Twisted, how they fit together, and the thought processes that went into designing them. It is truly rare that any library has documentation this clear and helpful, and you should be proud of your contribution.
I also feel lucky that out of all the times that I could have stumbled upon this, I happened to do so within 2 weeks of you finishing this epic series. Guess things just work out nicely sometimes
Thank you,
Jonathan
Thank you very much, and well done on your great timing
Not to mention finishing it so quickly!
Dave,
After thinking about Twisted for a while, it seems to me like it’s very similar to other event-engine frameworks, especially those dealing with GUI’s. For example, a common pattern in Javascript is to subscribe to an onMouseOver() event, where you specify code that gets control when an event fires. I’m very familiar with this model, and if this were all Twisted did I would be happy, but not particularly impressed.
The real magic of Twisted, as opposed to an ordinary event framework, is that deferreds are very lightweight and easy to create/listen to. Especially when combined with the @inlineCallbacks decorator, this is the best effort I’ve seen to simplify asynchronous programming. I’ve always hated the proliferation of callbacks that you get with event engines, and having lots of anonymous methods was always a pain (also annoyingly impossible in python).
Anyway, thanks again for introducing me to the magic of Twisted.
–Jonathan
Hey Jonathan, good points all.
This is the best tutorial ever! You are like the teacher whom you remember for all your life because he taught you more than you were supposed to know. Taking Erlang, Haskell and poetry (I didn’t know of Cummings before) to Twisted and Async programming in general counts to 5 topics instead of 1. Brilliant!
Thank you very much for your hard work!
You are quite welcome, thank you for the kind words.
That’s an attractive spiral.
I made it all by myself!
Thanks, it’s the best introduction to twisted that i have read, it’s great.
Thank you, enjoy!
Great Twisted tutorial! Thank you so much for writing it. And thank you for explaining deferreds and deferred lists, those were pretty confusing. The connection you drew through Erlang and Haskell between asynchronous programming and lazy evaluation was new to me, I know some Haskell but that had not occurred to me.
That crack you made about the reactor loop picture back in chapter 8 just about killed me.
Thanks very much! Glad you enjoyed it.
Pingback: Building a cache proxy server out of Twisted Framework « The World's Oldest Intern
Thanks for this very well written and informative tutorial, Dave. After reading through the Twisted docs originally, my head was spinning and I didn’t really grasp the concepts behind writing Twisted applications. Your tutorial helped immensely. You explained so many important details that the Twisted docs didn’t even bother covering that seem to be crucial in understanding how to use the framework properly. Well done.
Thanks for the kind words, glad it was helpful to you!