The last sentence
of Section 12.5.4.1. reads as follows:
"The repeatEvery
alarm event is created repeatedly each time the duration expires, while
the associated scope is active."
It is possible that
the execution of an onAlarm's child activity could take longer than the
value of its repeatEvery expression. Since concurrent execution of a
single onAlarm instance is not permitted (as stated in 12.5.7) then the
process would have to queue these onAlarm executions and fire the
onAlarm again once it has completed executing.
There are a few
possibilities here:
1) Avoid this issue
by rescheduling the alarm each time the activity within the onAlarm
completes. The drawback is that depending on the activities within the
onAlarm it might not truly fire every N seconds (or whatever its
expression duration evaluates to).
2) Allow the
queuing of the onAlarms and consider the onAlarm active until all of
the queued alarms have been dispatched. This will result in the scope
waiting for the alarms to get delivered.
3) Allow the
queuing of the onAlarms but do not consider the onAlarm active if it
has queued alarms. The scope will not wait for the onAlarm to process
any queued alarms.
I think option 3 is
the right approach.
As such, I propose
the following lines (in bold) be
added to section 12.5.4.1:
12.5.4.1. ALARM
EVENTS
The counting of
time for an alarm event with a duration starts when the enclosing event
handler is activated. An alarm event goes off when the specified time
or duration has been reached. Except for the repeatEvery alarm, an
alarm event is carried out at most once while the corresponding scope
is active; the event is disabled for the rest of the activity of the
corresponding scope after it has occurred and the specified processing
has been carried out. The repeatEvery alarm event is created repeatedly
each time the duration expires, while the associated scope is active.
Only a single instance of a repeatEvery
alarm is allowed to fire at one time. In the event that the execution of the alarm takes longer
than the specified repeatEvery
duration, then the scope will queue these
alarms and dispatch them immediately upon completion of the onAlarm's
current execution. In the event
that the scope has completed its normal execution then the scope will
only wait for the currently dispatched alarm to complete and not for
any queued repeatEvery alarms.