Learn R Programming

batchtools (version 0.9.0)

runHook: Trigger Evaluation of Custom Function

Description

Hooks allow to trigger functions calls on specific events. They can be specified via the ClusterFunctions and are trigged 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
function(reg, ...): Run before a job is successfully submitted to the scheduler on the master.
post.submit
function(reg, ...): Run after a job is successfully submitted to the scheduler on the master.
pre.do.collection
function(reg, cache, ...): Run before starting the job collection on the slave. cache is an internal cache object.
post.do.collection
function(reg, cache, ...): Run before terminating the job on the slave. cache is an internal cache object.

Usage

runHook(obj, hook, ...)

Arguments

obj
[Registry | JobCollection] Registry which contains the ClusterFunctions with element “hooks” or a JobCollection which holds the subset of functions which are executed remotely.
hook
[character(1)] ID of the hook as string.
...
[any] Additional arguments passed to the function referenced by hook. See description.

Value

Return value of the called function, or NULL if there is no hook with the specified ID.