taskdied, taskstarted
taskdied,
taskstarted — internal functions that call another function when a task starts or
stops.
taskdied (task_name, qname, domain, node, task_id)
taskstarted (task_name, qname, domain, node, task_id)
task_nameThe name of the task which started or stopped.
nodeThe node on which the task started or stopped.
task_idThe process ID for the task.
qnameThe name of the task's queue, if any.
domainThe DataHub domain for this task.
User-defined.
These functions are internal to Gamma. They call run_hooks (#taskstarted_hook,
args...) and run_hooks (#taskdied_hook,
args...) respectively. They are called whenever a task
registered with the Cascade NameServer (nserve) starts or
stops. You can set up hooks to use these functions through the add_hook
function.
![]() | |
These functions were originally available to programmers, and have
been internalized to allow for the greater flexibility of the
On the other hand, you could get both with something like this: builtin_taskdied = taskdied;
builtin_taskstarted = taskstarted;
function main ()
{
init_ipc ("x","x");
add_hook (#taskdied_hook, #hook_taskdied);
add_hook (#taskstarted_hook, #hook_taskstarted);
while(t)
next_event();
}
function taskdied (!a?...=nil)
{
princ ("task died: ", a, "\n");
funcall (builtin_taskdied, a);
}
function taskstarted (!a?...=nil)
{
princ ("task started: ", a, "\n");
funcall (builtin_taskstarted, a);
}
function hook_taskdied (!a?...=nil)
{
princ ("hook task died: ", a, "\n");
}
function hook_taskstarted (!a?...=nil)
{
princ ("hook task started: ", a, "\n");
} |