<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey,<div><br></div><div>Thanks for the quick response, this is exactly what I am looking for am works great.</div><div><br></div><div>Thanks again</div><div><br></div><div>Regards</div><div>David</div><div><div><div><br></div></div><div><br></div><div><div>On 20 Jul 2009, at 13:36, Glyph Lefkowitz wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><div class="gmail_quote">On Mon, Jul 20, 2009 at 8:26 AM, David Guerin <span dir="ltr">&lt;<a href="mailto:david@strotos.com">david@strotos.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hey all,<br> <br> I'm pretty new to Twisted Framework but things are going along nicely.<br> At the moment I am trying to get a timer to fire off say every 5<br> minutes.<br> What's the best way to do this with twisted?<br> I found an old link to a how to with timers in twisted on the<br> <a href="http://twistedmatrix.com" target="_blank">twistedmatrix.com</a> site but there wasn't a web page there when I clicked<br> </blockquote><div><br>You can use LoopingCall: &lt;<a href="http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.task.LoopingCall.html">http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.task.LoopingCall.html</a> &gt;, like so:<br> <br><div style="margin-left: 40px;">from twisted.internet.task import LoopingCall<br>MINUTES = 60.0<br>def myTimer():<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doSomeStuff()<br>repeater = LoopingCall(myTimer)<br>repeater.start(5 * MINUTES)<br></div></div> </div> _______________________________________________<br>Twisted-Python mailing list<br><a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python<br></blockquote></div><br></div></body></html>