Utility class that provides an API for managing
This is an internal utility used by DeepSee.
parameter EVENTNAME = "^DeepSee.Tasks.";
Name of system used to talk to agents.
parameter TIMEOUT = 0;
Timeout value (seconds) for events.
If no events are received, then the agent will shut itself down.
classmethod %AgentsAvailable(pPriority="H", Output pStatus)
- NOT IMPLEMENTED -
Agents are always available and created as needed. There is no need to test anymore.
classmethod %AttachToQueue(pQueueName As %String = "", Output pStatus As %Status = $$$OK)
Look up a token to reattach to a given WorkMgr queue.
After successfully serializing a WorkMgr instance, through either attachment to a pre-existing queue or initialization of a new queue,
the storage location for the provided pQueueName is marked with the null string to provide an indication the queue is
currently open and working.
Determine which work queue a task should be assigned to.
- NOT IMPLEMENTED -
The agents global is no longer used.
classmethod %CloseTask(pTaskGroup As %String, pParameters As %List)
This is called as the callback to %ExecuteTask which cleans up the management global. This
method will also close out the WorkQ if the group was create with pWait = 0.
classmethod %CreateAgents(pNumAgents As %Integer = "")
- NOT IMPLEMENTED -
This is handled by the WorkQMgr as part of task queueing operations
classmethod %CreateTaskGroup(Output pTaskGroup As %String, pWait As %Boolean = 0, pName As %String = "")
Initialization of a %SYSTEM.WorkMgr instance.
classmethod %DequeueTask(pTaskGroup As %String, pParameters As %List, pSuppressArchive As %Boolean = 0)
This is called in %ExecuteTask to mark the task "active" in the process logging.
classmethod %DestroyTaskGroup(pTaskGroup As %String = "", pPurgeTasks As %Boolean = 1)
Close down all work being done by this task group
classmethod %DetachFromQueue(pQueueName As %String = "", ByRef pWorkMgr As %SYSTEM.WorkMgr = $$$NULLOREF)
Detach from a given WorkMgr queue and store the current token needed to reattach.
If the storage location has been deleted before detaching from the queue (eg: by a cancellation operation),
then the token is discarded.
classmethod %ExecuteTask(pTaskGroup As %String, pParameters As %List, pSuppressArchive As %Boolean = 0)
This is run by the worker and will do the actual work of processing tasks via the work queue manager
WorkQ agents will be made available as needed. This test always returns True
classmethod %KillAgents(pPurgeTasks As %Boolean = 0)
Find all open WorkQ manager instances and shut them down
classmethod %KillLog(pMsg As %String)
Kill the agent log.
classmethod %KillTasksForGroup(pTaskGroup As %String)
This performs the actual cleanup work to remove all tasks assigned to a particular logical work group.
classmethod %Log(pMsg As %String)
Log a message to the agent log.
Print list of active tasks out to the console.
Print list of agents out to the console.
Print contents of the (global-based) agent log to the console.
Print list of pending (queued) tasks out to the console.
Print current task groups to the console.
classmethod %QueueTask(pTaskGroup As %String = "", pTaskType As %String, pCubeName As %String, pQueryKey As %String = "", pData As %String = "", pData2 As %String = "", pData3 As %String = "", pSQLParams As %String = "", pSuppressArchive As %Boolean = 0)
This is called from the foreground to
add a task to the queue of background tasks.
pTaskGroup must be defined in order to properly assign individual tasks
to a particular work queue.
Reset the WorkMgr.
classmethod %SetLoggingOptions(pUseArchive=0, pLogSize=100, pLogAll=0)
This stops all running agents, clears out all tasks, and clears the logs.
Turn on logging for the DeepSee background agents. These will be reset during a call to %KillLog.
classmethod %Test(pTaskCount=25, pTimeOut=0, pClean=1)
Perform simple test of DeepSee WorkMgr.
This will kill any pending task.
classmethod %WaitForTaskGroup(ByRef pTaskGroup As %String = "", Output pCompleted As %Boolean, pTimeOut As %Integer = 0)
Wrapper for the WorkQMgr:WaitForComplete() that parallels the original %DeepSee.TaskMaster version.