The End

Part 22: The End

This concludes the introduction started in the first part. You can find an index to the entire series.

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

  1. Port a synchronous program you wrote to Twisted.
  2. Write a new Twisted program from scratch.
  3. 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!

Figure 47: The End
Figure 47: The End
42 comments
  1. Shigeru

    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

  2. Jonathan

    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

  3. Jonathan

    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

  4. kornerr

    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!

  5. Asday

    That's an attractive spiral.

  6. wanderlife

    Thanks, it's the best introduction to twisted that i have read, it's great.

  7. Peter

    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.

  8. Sean

    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.

  9. Tim Stoop

    Great tutorial! Any chance you'll do a follow up with some more advanced topics? :)

  10. Tim Stoop

    x501? I mean x.500 of course :)

  11. real

    Hi Dave,
    Your series rocks. I read it from the beginning to the end, and I learned a lot.

    I really appreciate your work.
    real.

  12. chekkal

    Thank you for this tutorial. I've enjoyed reading it.

  13. Mark Goddard

    Thanks for a great introduction to twisted. It helped me to port a synchronous program to twisted with relative ease. It has also inspired me to actually read the copy of real world Haskell sitting on my desk!

  14. Ajak Saksow (@Saksow)

    Thanks for the amazing series !

  15. Adam Szpakowski

    I'm coming back to Twisted after close to 10 years, and Your series is great as a refresher.
    And You can write, You really can write ;)

  16. alexpulver

    Dave, this is an amazing work - this was the best introduction to asynchronous programming I could ever wish for. The path that you took us with you from the low level implementation to high level astractions help a lot to grasp the whole concept really well. Again, huge thanks for making this and making available to all.

  17. Xander

    So many years later this is still one of the best ways to learn twisted. If you still check this I just wanted to say thank you for your hard working making this. I found it incredibly helpful!

  18. Yash Sharma

    Hey Dave, this was an excellent coverage of Twisted. Thanks for explaining the concepts so well. I had a request for you, can you suggest any way, how to learn asyncio and converting an asynchronous program written in Twisted to Asyncio?