<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 4, 2010, at 9:23 PM, Thomas Drake wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">Hello,<br><br>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?<br>
<br>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 decorators.<br>
<br>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().<br>
<br>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.<br><br>Thanks,<br><br>Tad<br></span></blockquote></div><div><br></div><div>Calling reactor.stop() is possibly the best that you're likely to do right now. &nbsp;This is a known problem, and at least related to (if not the same as)&nbsp;&lt;<a href="http://twistedmatrix.com/trac/ticket/718">http://twistedmatrix.com/trac/ticket/718</a>&gt;.</div><div><br></div></body></html>