Skip to main content


class Ens.Alarm extends Ens.Host

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.

Method Inventory


parameter DOMAIN = Ensemble;
parameter INVOCATION = Queue;
2 modes: Queue, InProc
parameter LOCKTIMEOUT = 2;
Lock timeout used when adding data to the main $$$EnsAlarm global.
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) as %Status
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) as %Status
Helper method to mark an alarm as interrupted.
method MessageHeaderHandler(pRequestHeader As Ens.MessageHeader, Output pResponseHeader As Ens.MessageHeader) as %Status
method OnInit() as %Status
Load any suspended tasks from $$$EnsSuspendedAppData when this config item is started. Note that only one config item will receive ALL previously suspended tasks.
method OnTask() as %Status
Inherited description: Event loop for Actor and BusinessOperation. This is called only when INVOCATION is Queue.
method OnTearDown() as %Status
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 = "") as %Status
Helper method to correctly remove an alarm.
classmethod RemoveAlarmFromRequestor(pRequestHeaderId As %Integer) as %Status
Helper method to remove DiscardOnShutdown alarm request from requestor.
classmethod SuspendAlarms() as %Status
Move Alarm data from ^Ens.Alarm to ^Ens.SuspendedAppData("Ens.Alarm"). Note that requests with DiscardOnShutdown=1 will not be suspended.

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab