SEND IN TIMe

Sarah Reichelt sarah.reichelt at gmail.com
Wed Oct 21 02:56:13 EDT 2009


> "SEND message TO ME IN nnn SECONDS" works fine as long as there is nothing
> else happening in my PC at the time.  I've had it run for entire weekends
> with no problems.  The interval is set to 7 Minutes.
>
> However, during weekdays when I am doing some other activity, it
> occasionally hiccups.  It happens several  times during the day -- where
> "several" can be as many as a dozen, depending on how busy I am.  I
> frequently have multiple non-Rev windows open performing several different
> tasks, some of which are CPU intensive.  That's when my Rev application
> doesn't re-trigger itself.  At least it doesn't appear to.

Are you running a standalone or from inside the Rev IDE? I have had
messages lost due to editing the script at the wrong moment.

However in critical apps with lots of pending messages, I put in
another handler that checks that all the expected messages are in the
pendingMessages list and re-schedules them if they are not. It then
calls itself. The other pending messages also check to see that the
message checking handler is in the queue, so they are each checking
each other. Using this routine, I have never had problems with missing
messages in a standalone. And I'm not sure that it is really
necessary, but I started doing it for an app with lots of scheduled
messages where it was unattended and vital. Messages can be delayed if
the app is busy doing something else, but I haven't had any go
missing.

One other good technique is to reschedule the next call to the handler
at the start of the handler instead of at the end. This means that
even if there is a problem when running the handler, the pending
message has already been created. And if timing is slightly more
important, it removes the time taken to complete the handler from the
calculation for the next event.

Cheers,
Sarah



More information about the use-livecode mailing list