[Twisted-Python] Timers in Twisted
David Guerin
david at strotos.com
Mon Jul 20 07:01:13 MDT 2009
Hey,
Thanks for the quick response, this is exactly what I am looking for
am works great.
Thanks again
Regards
David
On 20 Jul 2009, at 13:36, Glyph Lefkowitz wrote:
>
> On Mon, Jul 20, 2009 at 8:26 AM, David Guerin <david at strotos.com>
> wrote:
> Hey all,
>
> I'm pretty new to Twisted Framework but things are going along nicely.
> At the moment I am trying to get a timer to fire off say every 5
> minutes.
> What's the best way to do this with twisted?
> I found an old link to a how to with timers in twisted on the
> twistedmatrix.com site but there wasn't a web page there when I
> clicked
>
> You can use LoopingCall: <http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.task.LoopingCall.html
> >, like so:
>
> from twisted.internet.task import LoopingCall
> MINUTES = 60.0
> def myTimer():
> doSomeStuff()
> repeater = LoopingCall(myTimer)
> repeater.start(5 * MINUTES)
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20090720/f67a63c1/attachment.html>
More information about the Twisted-Python
mailing list