<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&#39;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&#39;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&#39;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>      doSomeStuff()<br>repeater = LoopingCall(myTimer)<br>repeater.start(5 * MINUTES)<br></div></div>
</div>