Skip to main content

%DeepSee.TaskMaster

class %DeepSee.TaskMaster extends %Library.RegisteredObject

Utility class that provides an API for managing DeepSee tasks.
This is an internal utility used by DeepSee.

Method Inventory

Parameters

parameter EVENTNAME = ^DeepSee.Tasks.;
Name of system used to talk to agents.
parameter LOGALL = 0;
If true, log additional information (for diagnostics).
parameter LOGSIZE = 100;
Number of items to store in the task master event log.
parameter TIMEOUT = 0;
Timeout value (seconds) for events. If no events are received, then the agent will shut itself down.
parameter USEARCHIVE = 0;
If true, maintain archive of processed tasks (for diagnostics).

Methods

classmethod %AgentsAvailable(pPriority="H", Output pStatus) as %Integer
Return the number of High priority agents available for background tasks.
classmethod %BestQueue()
Return the queue with the most space currently to queue tasks to or "H" if there are no queues present
classmethod %CleanAgentsGlobal() as %Status
True up the agents global
classmethod %CreateAgents(pNumAgents As %Integer = "") as %Status
This is called from the foreground to create a set of background agents.
classmethod %CreateTaskGroup(Output pTaskGroup As %String, pNotify As %Boolean = 0, pName As %String = "") as %Status
Create a new task group.
A task group is a set of related tasks. If pNotify is true then you will be notified via an event (named pTaskGroup) when the last task in the group is complete.
pName is an optional label used as part of the group name to track who created the task group.
classmethod %DequeueTask(pPriority As %String, Output pTimedOut As %Boolean, Output pNotify As %String, Output pTaskGroup As %String, Output pTaskId As %String, Output pTaskType As %String, Output pCubeName As %String, Output pQueryKey As %String, Output pData As %String, Output pData2 As %String, Output pData3 As %String, Output pContext, Output pSQLParams) as %Status
This is called by agents when they wish to wait on a new task.
classmethod %ExecuteTask(pTaskGroup As %String, pTaskType As %String, pCubeName As %String, pQueryKey As %String, pData As %String, pData2 As %String, pData3 As %String, pSQLParams) as %Status
This is called by agents in order to execute a given task.
classmethod %IsActive() as %Boolean
This is called from the foreground to test if the task agents are running.
classmethod %KillAgents(pPurgeTasks As %Boolean = 0) as %Status
This is called from the foreground to kill all background agents.
classmethod %KillLog(pMsg As %String) as %Status
Kill the agent log.
classmethod %KillTasksForGroup(pTaskGroup As %String = "") as %Status
Remove all tasks queued for a given task group. This is called when the user cancels a query, for example.
classmethod %Log(pMsg As %String)
Log a message to the agent log.
classmethod %PrintActiveTasks()
Print list of active tasks out to the console.
classmethod %PrintAgents()
Print list of agents out to the console.
classmethod %PrintLog()
Print contents of the (global-based) agent log to the console.
classmethod %PrintPendingTasks()
Print list of pending (queued) tasks out to the console.
classmethod %PrintTaskGroups()
Print current task groups to the console.
classmethod %QueueTask(pPriority As %String, pNotify As %String, 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) as %Status
This is called from the foreground to add a task to the queue of background tasks.
pNotify, if not "", indicates that a signal should be sent to this event when the task is complete.
pTaskGroup, if not "", indicates that this task is part of a group of related tasks.
pPriority must be "H" or "L".
classmethod %Reset() as %Status
Reset the TaskMaster.
This stops all running agents, clears out all tasks, and clears the logs.
classmethod %SetLoggingOptions(pUseArchive=0, pLogSize=100, pLogAll=0)
Turn on logging for the DeepSee background agents. These will be reset during a call to %KillLog().
classmethod %Test(pClean=1)
Perform simple test of DeepSee TaskMaster. This will kill any pending task.
classmethod %WaitForTaskGroup(pTaskGroup As %String, Output pCompleted As %Boolean, pTimeOut As %Integer = 0) as %Status
This is called from the foreground to wait for a group of related tasks to complete.
You cannot queue additional tasks to a task group once you have called this method.
If pCompleted is set true if the task group is complete.
If pTimeOut is non-zero, specifies number of seconds to wait.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab