[Twisted-Python] service stops/twistd exits

Thomas Drake thomasdrake1 at gmail.com
Wed Aug 4 21:23:48 EDT 2010


I'm wondering if there is an established pattern for having an application
running in twistd shut itself down in the absence of a running service?

The idea is that if a service fails it calls self.stopService() and the
application shuts itself down somehow (rather than having the service call
reactor.stop). Ideally, I was hoping to do with without any specialized code
within my service, ie subclass from a ManagedService class or using

I supposed it's possible to write a monitoring service that checks to ensure
my service is running, but I'd prefer a tighter coupling like having a
FatalException bubble up from the failed service to the application,
MultiService, or whatever *should* be calling reactor.stop().

Otherwise, if having service (eventually) stop the reactor is totally
antithetical to how things should work in a twistd plugin, then I guess I'll
need to rethink things.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20100804/306d6088/attachment.htm 

More information about the Twisted-Python mailing list