The Ens.Alarm code is designed for use in a single process, so users should ensure
that they do not configure Ens.Alarm to run with a PoolSize greater than 1.
parameter INVOCATION = "Queue";
2 modes: Queue, InProc
parameter LOCKTIMEOUT = 2;
Lock timeout used when adding data to the main $$$EnsAlarm global.
parameter RECOVERYLOCKTIMEOUT = 10;
Lock timeout used when moving data into or out of a suspended state.
method AddAlarm(pWakeTime As %String, pRequestHeaderId As %Integer, pAlarmHandle As %Integer, pDiscardOnShutdown As %Integer = 0, pIsInterrupted As %Boolean = 0)
Helper method to correctly add an alarm. The main data is stored in ^Ens.Alarm, and the ^||ISC.Ens.Alarm
process-private global is used to store index data to avoid local memory exhaustion.
The ^Ens.Alarm data stores the main data for the request subscripted by the AlarmRequest ID.
Two subscripts in the PPG are used to index the data. The "Time" subscript is an index based on the requested wakeup time.
The "Interrupt" index is an index for items that have received interrupt requests.
method CheckAlarmTasks(Output pResponseHeader As Ens.MessageHeader, Output pTimeToNextEvent As %Integer, Output pResponseHandle As %Integer)
method InterruptAlarm(pAlarmHandle As %Integer = -1)
Helper method to mark an alarm as interrupted.
method MessageHeaderHandler(pRequestHeader As Ens.MessageHeader, Output pResponseHeader As Ens.MessageHeader)
Load any suspended tasks from $$$EnsSuspendedAppData when this config item is started.
Note that only one config item will receive ALL previously suspended tasks.
Event loop for Actor and BusinessOperation.
This is called only when INVOCATION is Queue.
This method previously ran the code that is now in SuspendAlarms(), but
that code is now invoked from Ens.Director during production shutdown.
method RemoveAlarm(pAlarmHandle As %Integer = -1, pTimeIndexUsedForAlamHandle As %String = "")
Helper method to correctly remove an alarm.
classmethod RemoveAlarmFromRequestor(pRequestHeaderId As %Integer)
Helper method to remove DiscardOnShutdown alarm request from requestor.
Move Alarm data from ^Ens.Alarm to ^Ens.SuspendedAppData("Ens.Alarm").
Note that requests with DiscardOnShutdown=1 will not be suspended.