[Twisted-Python] Life cycle of ApplicationServices
Itamar Shtull-Trauring
itamar at itamarst.org
Tue Oct 25 09:27:30 MDT 2005
On Tue, 2005-10-25 at 15:03 +0200, Eric Basley wrote:
> The FIX main application is an engine able to manage many FIX sessions
> and is controled by web services. A session may act as a TCP server or
> client. Sessions have starting time and stopping time. For a client
> session I'm using a protocol.ReconnectingClientFactory. With
> Twisted-2.0.1 there is no way to stop properly a service and there is
> no way to destroy (factory, protocol, connector, ...) associated to the
> service.
Services (I assume you're using twisted.application.service here) are
meant typically for "persistent" objects, encapsulating a specific
system's business logic. In some cases this might be a thin wrapper
around factory, but if you are opening many short-lived connections you
probably don't want to encapsulate as a service. For example, a Web
crawler might be a service - you can start and stop it, configure where
it goes; the specific HTTP connections it manages shouldn't be services.
More information about the Twisted-Python
mailing list