Twisted contains a large number of examples. One in particular,
the "evolution of Finger" tutorial, contains a thorough
explanation of how an asynchronous program grows from a very
small kernel up to a complex system with lots of moving parts.
Another one that might be of interest to you is the tutorial
about simply writing servers. The key thing to keep in mind
about Twisted, or even other asynchronous networking libraries
(such as asyncore, MINA, or ACE), is that your code only gets
invoked when something happens. The part that I've heard most
often sound like "voodoo" is the management of callbacks: for
example, Deferred. If you're used to writing code that runs in a
straight line, and only calls functions which return immediately
with results, the idea of waiting for something to call you back
might be confusing. But there's nothing magical, no "voodoo"
about callbacks. At the lowest level, the reactor is just
sitting around and waiting for one of a small number of things
to happen: - Data arrives on a co