"Page Load Actions" & "Wake up / Resume Actions"

Forum to ask for any help
Post Reply
cv27
Posts: 230
Joined: Sat Nov 24, 2012 10:15 pm
Location: Montréal, QC, Canada

"Page Load Actions" & "Wake up / Resume Actions"

Post by cv27 » Fri Apr 10, 2015 12:13 am

Scenario 1: I have page load actions recurring every 60 seconds and DemoPad is active (has focus)
Question: Will the "page load" actions be executed at initial page load, then every 60 seconds thereafter -OR- only at +60 seconds, +120 seconds.... ?

Scenario 2: DemoPad is active (has focus), page-1 is displayed at time+0 and has page load actions every 60 seconds, iDevice is put to sleep at time+45, then awakened at time+90
Question 1: upon wake up, will the Page-1 "Page load" actions occur at time+90 then time+150 -OR- at time+120 then time+180? In other words, is the timing of the "page load" actions reset to zero upon wake up or keeps the interval from the initial load?
Question 2: If the answer to Scenario 2 above is that Page-1 "Page load" actions occur at time+90 and if the Project has "Wake up" actions defined as well, which set of actions gets executed first?

User avatar
DemoPad
Site Admin
Posts: 735
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: "Page Load Actions" & "Wake up / Resume Actions"

Post by DemoPad » Fri Apr 10, 2015 3:55 pm

cv27 wrote:Scenario 1: I have page load actions recurring every 60 seconds and DemoPad is active (has focus)
Question: Will the "page load" actions be executed at initial page load, then every 60 seconds thereafter -OR- only at +60 seconds, +120 seconds.... ?
At initial page load, then also at +60, +120 etc
cv27 wrote: Scenario 2: DemoPad is active (has focus), page-1 is displayed at time+0 and has page load actions every 60 seconds, iDevice is put to sleep at time+45, then awakened at time+90
Question 1: upon wake up, will the Page-1 "Page load" actions occur at time+90 then time+150 -OR- at time+120 then time+180? In other words, is the timing of the "page load" actions reset to zero upon wake up or keeps the interval from the initial load?
Question 2: If the answer to Scenario 2 above is that Page-1 "Page load" actions occur at time+90 and if the Project has "Wake up" actions defined as well, which set of actions gets executed first?
Whenever a page load action is executed, a timer is set for when the next one should execute. If the app has been asleep past that time, then the page load action will execute as soon as the app wakes up. If not, the remaining time will pass before the page load repeat action fires. Eg repeat command every 60 seconds. Close the app down after 30 seconds, then resume it 10 seconds later. The repeat command will execute 20 seconds after that. But keep the app closed for more than 60 seconds, the repeat action will execute as soon as the app wakes up (before the wakeup/resume actions), and then set another timer for 60 seconds later.

You should assume that page load actions fire first, and put a slight delay on wake up actions if needed.

cv27
Posts: 230
Joined: Sat Nov 24, 2012 10:15 pm
Location: Montréal, QC, Canada

Re: "Page Load Actions" & "Wake up / Resume Actions"

Post by cv27 » Fri Apr 10, 2015 4:28 pm

Great info, thanks.

When you say "Whenever a page load action is executed, a timer is set", I assume that timer is 'frozen' while DemoPad doesn't have focus, correct?

User avatar
DemoPad
Site Admin
Posts: 735
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: "Page Load Actions" & "Wake up / Resume Actions"

Post by DemoPad » Fri Apr 10, 2015 4:43 pm

It is not really frozen no, it just stops checking whether the command should execute. It goes like this:

Execute a command at 1:05pm, and have it repeat every 60 seconds. So the app knows to execute the next action at 1.06pm. 1.06pm is the new 'execute' time.

Whilst the app is running, a check is made constantly to see if 1.06pm has occurred - and if so, the action is fired & a new execute time set.

If the app shuts down for just 10 seconds at 1.05:05, when it resumes, it is not yet 1.06pm, so it waits until then to execute.

But if the app is shut down for 5 minutes, and re-opens at 1.10pm, then it is now after 1.06pm, hence the action fires immediately, and a new 'execute time' is set for 1.11pm.

Post Reply