runHook {batchtools} | R Documentation |
Trigger Evaluation of Custom Function
Description
Hooks allow to trigger functions calls on specific events.
They can be specified via the ClusterFunctions
and are triggered on the following events:
pre.sync
function(reg, fns, ...)
: Run before synchronizing the registry on the master.fn
is the character vector of paths to the update files.post.sync
function(reg, updates, ...)
: Run after synchronizing the registry on the master.updates
is the data.table of processed updates.pre.submit.job
function(reg, ...)
: Run before a job is successfully submitted to the scheduler on the master.post.submit.job
function(reg, ...)
: Run after a job is successfully submitted to the scheduler on the master.pre.submit
function(reg, ...)
: Run before any job is submitted to the scheduler.post.submit
function(reg, ...)
: Run after a jobs are submitted to the schedule.pre.do.collection
function(reg, reader, ...)
: Run before starting the job collection on the slave.reader
is an internal cache object.post.do.collection
function(reg, updates, reader, ...)
: Run after all jobs in the chunk are terminated on the slave.updates
is adata.table
of updates which will be merged with theRegistry
by the master.reader
is an internal cache object.pre.kill
function(reg, ids, ...)
: Run before any job is killed.post.kill
function(reg, ids, ...)
: Run after jobs are killed.ids
is the return value ofkillJobs
.
Usage
runHook(obj, hook, ...)
Arguments
obj |
[Registry | JobCollection] |
hook |
[ |
... |
[ANY] |
Value
Return value of the called function, or NULL
if there is no hook
with the specified ID.