Thanks for the clarification!
-martin
-----Original Message-----
From: twisted-web-bounces at twistedmatrix.com [mailto:twisted-web-bounces at twistedmatrix.com] On Behalf Of glyph at divmod.com
Sent: Tuesday, April 07, 2009 10:04 PM
To: Twisted Web World
Subject: Re: [Twisted-web] some questions about twisted.web
On 7 Apr, 07:47 pm, jack at chesspark.com wrote:
>>You can pass arbitrary command line options by writing a plugin.
>>http://twistedmatrix.com/projects/core/documentation/howto/tap.html>>Which, as I recall, Glyph and others have discourged others from doing
>this. Perhaps I am mistaken, but if twistd is intended for this
>purpose, why has this not become part of it all along?
Chris has already basically set the record straight here, but for future
readers I just wanted to have a direct reply to this message and clear
up a very unfortunate choice of acronyms. Some of this is a summary of
other things that have already been mentioned in this thread.
I definitely do not discourage the use of twistd for this purpose :).
In fact I strongly recommend it. Here's the history.
".tap" ("Twisted Application Pickle") files, and the associated "mktap"
("make twisted application pickle") command-line utility, are strongly
discouraged. They've been deprecated for a long time, and they'll be
gone soon.
"TAPs" ("Twisted Application *Plugins*") were originally plugins for
"mktap". That's why the naming is similar. However, *they are now
plugins for twistd*, and have been for some time. Developers are
strongly encouraged to use this interface, and to read the document
linked above.
Before "TAPs" were plugins for twistd, the suggested configuration
mechanism for twisted applications was to write a '.tac' file and tell
your users to edit it. Processing twistd's commandline arguments at
this point was impossible without gratuitous hacks, so tac files were a
better alternative. However, as Jack noted, editing tac files is
inconvenient, so we added the twistd plugin interface. We now recommend
that adding command-line arguments to your 'twistd' plugin is the way to
go if you want run-time configuration for your twisted server
application.
The technique that Chris suggested elsewhere in this thread, to set up
correct command-line arguments for your plugin and then call twistd's
run() function, is the currently supported way to invoke twistd's
functionality from your own scripts. This is what we use to support
Divmod's "axiomatic" command, which is basically a database-configured
version of "twistd". A more expressive API for a wider variety of use-
cases is forthcoming, but this technique should still work even once
such an API has been added.
The document in question would really benefit from some updating; in
particular, it would be good to move the mention of TAP files to some
kind of endnote rather than being mentioned before the actual relevant
features.
_______________________________________________
Twisted-web mailing list
Twisted-web at twistedmatrix.comhttp://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web