The eo
argument is a list that can be used to specify various options.
The current options are: eo$blocking
, and eo$accumulator
. The eo$blocking
option is used to indicate whether to wait for the
results, or to return as soon as the tasks have been submitted. If
set to FALSE
, eachWorker
will return a sleighPending
object that is used to monitor the status of the tasks, and to
eventually retrieve the results. You must wait for the results to be
complete before executing any further tasks on the sleigh, or an
exception will be raised. The default value is TRUE
.
The eo$accumulator
option can be used to specify a function
that will receive the results of the task execution. Note that while
this can be a very useful feature with eachElem
, it's not
commonly used with eachWorker
, but is included for consistency.
The first argument to eo$accumulator
function is a list of
results, where the length of the list is always equal to 1 (because
there is no eo$chunkSize
option in eachWorker
). The second
argument is a vector of task numbers, starting from 1, where the
length of the vector is also always equal to 1. The task numbers are
not very important when used with eachWorker
, because the order
of tasks isn't specified, as it is with eachElem
. Note that
when eo$accumulator
is specified, eachWorker
returns
NULL
, not the list of results, since eachWorker
doesn't save
any of the results after passing them to the eo$accumulator
function.
The DEBUG
argument is used call the browser
function
upon entering eachWorker
. The default value is FALSE
.