[Twisted-Python] Re: In Defense of Taps
glyph at twistedmatrix.com
Wed Feb 12 08:51:46 EST 2003
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.
While this may present a superficially simpler start-up process for new users
creating their first application, it will create the impression that TAPs are
something esoteric that you shouldn't necessarily be using if you're just
building a canonical Twisted server.
I'm afraid that I've already created that impression, though. In going through
various projects I'm aware of that use Twisted, very few of them use TAPs.
Sadly, a few of the projects that I tried which use Twisted don't work at all!
(I'm not listing those here.) It seems like this framework is more popular for
internal development than open source work.
The two public projects that I know of which use TAPs well are:
* Bannerfish: http://itamarst.org/software/bannerfish/
* CVSToys: http://www.twistedmatrix.com/users/acapnotic/wares/code/CVSToys/
Both of these are written by Twisted development team members that I have
gotten to scream at personally :-).
* The Hep Message Server: http://www.fettig.net/projects/hep/
No use of TAPs or twistd whatsoever, it uses its own start-script.
Accordingly, the "daemon" responds badly to signals, and doesn't daemonize on
UNIX. On the other hand, this may not just be a case of poor advocacy.
There is also an INI file, no use of distutils, and the package structure is
scattered across the top level namespace with unique and distinctive names
like "servers", "messaging", and "agents".
Abe has produced a nice message server demo here but appears singularly
unconcerned with integration of any kind :).
* apt-proxy v2: http://apt-proxy.sourceforge.net/
This project uses a collection of scripts which can either be used as
standalone daemons or arguments to the "--python" option to twistd. It's
understandable given the low-level platform-specific nature of this code, and
they still get about half the benefits of twistd.
* khashmir: http://khashmir.sourceforge.net/
I can't figure out what's going on here. I _think_ from the README that
you're still expected to type python expressions at a prompt and get results.
Given that there are no releases of this yet it's probably premature to guess
whether taps will be used or not ;-).
There are two conclusions I can draw from this brief survey:
1. Not very many mature projects use Twisted yet.
2. Everybody hates TAPs unless I've personally explained why they shouldn't.
I get the impression that both conclusions are valid. Not much can be done
about #1 except to stay the course. If you are currently writing tap-less
code, has this thread convinced you to take another look at plugins? Or at
least wait and see what the next iteration of COIL will be like?
Another thing that I notice here is that Twisted's internal TAP plugins need to
provide slightly more expansive descriptions of what they do, for the browsing
functionality I've described to be useful. For example:
glyph at zelda:~% mktap --help portforward
[ ... ]
| <`'> | Glyph Lefkowitz: Traveling Sorcerer |
| < _/ > | Lead Developer, the Twisted project |
| < ___/ > | http://www.twistedmatrix.com |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030212/e937eea8/attachment.pgp
More information about the Twisted-Python