Pausing and Resuming a Work Queue
For use with the Work Queue Manager, the %SYSTEM.WorkMgrOpens in a new tab class provides methods you can use to pause and resume work within a work queue.
For information on halting work completely, see Stopping a Work Queue and Removing Work Items.
method Pause(timeout As %Integer, ByRef completed As %Boolean = 0) as %Status
Prevents the worker jobs associated with this work queue from accepting additional items from this work queue. The Pause() method also stops any work items that are in progress.
The timeout argument represents the amount of time in seconds that the method waits before stopping work items that are in progress. After the timeout period, the method returns the completed value, which indicates whether the work items that were in progress when you called the Pause() method were completed. Consequently, you can pass in a timeout value of 0 to know immediately whether the worker jobs completed all the work items in the work queue.
method Resume() as %Status
Resumes work in this work queue, if it had previously been paused using the Pause() method. Specifically, this method enables the work queue processes to accept and start any additional items in the work queue.