Page 1 of 1

Making an operation every x seconds

Posted: Wed Jun 09, 2010 2:01 pm
by tal
Hi,

Revolution is not multi thread, so I dont know how to make an operation for example every 120 seconds.

Every 120 seconds a script is executed and when finished it waits 120 seconds to be executed again... and during this duration, the application works normally. Have you got a clue? Thanks

Tal

Re: Making an operation every x seconds

Posted: Wed Jun 09, 2010 2:50 pm
by Klaus
Hi Tal,

you can "send" a message every x (milli-)seconds, this is the way to go:

Code: Select all

command doThis
  ## do this
  ## do that
  ## do another important thingie
  send "doThis" to me in 120 secs
end dothis
Then call it once whenever you need to start you actions like

Code: Select all

on openstack
  dothis
  ...
end openstack
Lookup "send" and "pendingmessages" in the docs (Rev dictionary).


Best

Klaus

Re: Making an operation every x seconds

Posted: Wed Jun 09, 2010 2:55 pm
by tal
Ok I try it, thank you