When a task registers a name with nserve it can thereafter receive information regarding any other nserve registered task that starts or stops.
This is done by defining two functions with specific names, each within their respective code, to handle this information. The functions are:
function taskstarted_hook (name, queue, domain, node, id);
and
function taskdied_hook (name, queue, domain, node, id);
The body of each of these functions is up to the programmer. Most "hook" functions check the name, queue, and possibly the domain of the started/stopped task and then take a specific action such as:
restarting a task that has died;
informing the user that a module has died;
inform other modules that a new service is available;
query the new module for information; and,
DataHub instance start/stop.