<div dir="ltr">Hi Jonathan<div><br></div><div>You might also find something like this useful: <a href="http://twistedmatrix.com/pipermail/twisted-python/2009-December/021107.html">http://twistedmatrix.com/pipermail/twisted-python/2009-December/021107.html</a></div>
<div style><br></div><div style>Optionally, it would be easy to add a timeout value to the class that could cancel outstanding deferreds after a certain amount of time and then fire all the waiters.</div><div><br></div><div>
Terry</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 12, 2013 at 9:40 PM, Jonathan Vanasco <span dir="ltr"><<a href="mailto:twisted-python@2xlp.com" target="_blank">twisted-python@2xlp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div class="im"><div>On Jun 12, 2013, at 4:31 PM, Glyph wrote:</div><br><blockquote type="cite">
<div style="word-wrap:break-word"><div><div>I'm not sure what "autoload" is.  I am assuming it's some kind of auto-re-loading technology though.</div></div></div></blockquote><div><br></div></div><div>The earlier discussions talked about Django's autoload, which reloads the entire process on a config file change.</div>
<div class="im"><br><blockquote type="cite"><div style="word-wrap:break-word"><div><div>You <i>do</i> want to re-start your process.  What you're diagnosing is some weird, unknown thread/process interaction and unless you get a clean slate, you don't know what is happening.</div>
<div><br></div><div>You may not want to do so <i>immediately</i>, though, since, as you say:</div></div></div></blockquote><div><br></div></div><div>Correct on both accounts.  I don't want to kill the current process while it's talking to an API.  I just want it to not talk to any additional APIs, then kill the process a bit later.</div>
<div class="im"><br><blockquote type="cite"><div style="word-wrap:break-word"><div><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
I'd like them to finish , and shutdown/restart N seconds later ( assuming that I wouldn't be able to fully shutdown because of an issue with a locked thread ).  <br></div></blockquote><br>The issue is with letting them finish.  In order to accomplish this, you should write IService implementations that have stopService methods that, when called, will wait for any operations in flight associated with that service.</div>
<div><br></div><div>Once everything is quiesced, you can re-exec ([sys.executable] + sys.argv) and that ought to result in the same process starting up again.  If you've done the appropriate thing and made all your stopService methods wait for their operations to complete, then waiting for them all to complete is just putting them all into a MultiService, calling stopService() on that MultiService, and adding a callback/errback to the Deferred it returns which calls os.exec.</div>
</div></blockquote><br></div></div><div>ok great !  I'll look into StopService and IService tomorrow !</div><div><br></div><div>thanks a ton.  that's pretty much what i want/need.</div><br></div><br>_______________________________________________<br>

Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
<br></blockquote></div><br></div>