I need to run function with an interval of 10 minutes. What is the
best way to do that?
--
Всего наилучшего!
--
To unsubscribe, reply using "remove me" as the subject.
> IOLoop.add_timeout
> """Calls the given callback at the time deadline from the I/O
Otavio, thank you. Can you give me a small example how to use this
method?
--
To unsubscribe, reply using "remove me" as the subject.
> You can use tornado.ioloop.PeriodicCallback to create a period timer.
> Of course you can call IOLoop.add_timeout to create a timeout
> callback.Note that the timer created by IOLoop.add_timeout will run
> only once.
>
> Maybe the code bellow will do you a favour:
>
> def callback():
> print "DO SOMETHING HERE"
>
> #milliseconds
> interval_ms = 10 * 60 * 1000
> main_loop = tornado.ioloop.IOLoop.instance()
> scheduler = tornado.ioloop.PeriodicCallback(callback,interval_ms,
> io_loop = main_loop)
> #start your period timer
> scheduler.start()
> #start your loop
> main_loop.start()
Season, thank you very much for that complex example!
Also, thanks to Otavio and Ken.