[Twisted-Python] Re: In Defense of Taps

Andrew Bennetts andrew-twisted at puzzling.org
Wed Feb 12 20:14:52 EST 2003

On Wed, Feb 12, 2003 at 07:51:46AM -0600, Glyph Lefkowitz wrote:
> On Wed, 12 Feb 2003 10:54:34 +1100, Adrian van den Dries <az at CANTANKER.NET> wrote:
> > Perhaps the TAP references in the howto should be moved later, under
> > "Advanced usage" or somesuch, and the early docs concentrate on methods with
> > which more users will be familiar (ie, standalone scripts).
> This is exactly what I was arguing against.

I disagree.  TAPs have two benefits that I can see:
    - you can use twistd, which gives you solid daemonisation, signal
      handling, and logging.
    - you can get some sort of minimal integration using mktap --append.
    - a vague promise that they'll do so much more later

Most people don't care about the second point, and you can actually still use
twistd without TAPs for the daemonisation, etc, if you really want.

Regardless, if you're looking to learn how to use this cool Twisted thing
you've heard about, daemonisation and whatnot can wait.  You want to try write
code that serves some wacky protocol you have, or whatever, and find out if
Twisted is suited to what you're trying to do.  It's nice to know that you
*can* take advantage of pre-written daemonisation, but I really doubt that a
new Twisted user cares about *how*.

Frankly, I see TAPs as one more concept that a new user shouldn't be
burdened with comprehending.  Reactors, Factories, Protocols, Transports and
Deferreds are hard enough on their own.  I really think docs that start by
using reactor.listenTCP, and possibly app.listenTCP, are the way to go.

Don't try make people swallow all of Twisted at once... it's just too big.

I'll even go so far as speculating that this will cause more external
projects to use TAPs, because they won't be seen as some annoying idea in
the beginner docs that they had to skip past to get real work done.  Give
Twisted plugins its own, comprehensive doc that can assume knowledge of
basic Twisted, rather than short-changing it by making it the introductory
doc.  It could start with a section titled "Motivation", explaining the
advantages of twistd and mktap.


More information about the Twisted-Python mailing list