[Twisted-Python] Question about TAC apps and TCPClient/Server vs reactor.connect/listenTCP

Paul Goins general at vultaire.net
Tue Dec 22 00:14:45 MST 2009


I'm embarrassed to ask about this, but I think my understanding may be
unclear about the differences in how the various TCP connection
functions work in Twisted.

For the record, I have read the docs at
http://twistedmatrix.com/documents/current/core/howto/application.html.
 But if I missed something key there, please point it out.

Got a TAC application, currently implemented using several TCPServer
objects.  Got a web service running as the main app, with MySQL and AMQP
connections also set up the same way, and probably I'll be adding a
memcached TCPClient in the near future.

The issue is this: I now need to support selectively turning on and off
these various components of the software.  Also, some services may not
always be needed, so specifying as part of the service hierarchy doesn't
seem correct.

Any suggestions of how to do this?  Should I be specifying only "core"
stuff as services of the application object, and connecting the others
via reactor.connectTCP/listenTCP as needed?  Can I add to and remove
services from the application object once the reactor starts?

Thanks.

- Paul




More information about the Twisted-Python mailing list