A TaskList stores and retrieves one or more tasks.
Details
The TaskList class is used as a storage class. It provides a container that
holds a collection of Task objects, along with a collection of methods for
adding, removing, and getting Tasks. It can also report on the status of the
Tasks contained within the list and retrieve results from those Tasks. What
it cannot do is manage interactions with Workers or arrange for the Tasks to
be executed. That's the job of the Queue.
Methods
Method get_task()
Return a single Task contained in the TaskList. The
Task is not removed from the TaskList, and has reference semantics:
if the listed task is completed by a Worker, then the status of any
Task returned by this method will update automatically
Method retrieve()
Retrieves the current state of all tasks.
Returns
Returns a tibble containing the results of all tasks and
various other useful metadata. Contains one row per task in the
TaskList, and the following columns:
task_idA character string specifying the task identifiersworker_idAn integer specifying the worker process ids (pid)stateA character string indicating the status of each task ("created", "waiting", "assigned", "running", or "done")resultA list containing the function outputs, or NULLruntimeCompletion time for the task (NA if the task is not done)funA list containing the functionsargsA list containing the arguments passed to each functioncreatedThe time at which each task was createdqueuedThe time at which each task was added to aQueueassignedThe time at which each task was assigned to aWorkerstartedThe time at which aWorkercalled each functionfinishedThe time at which aWorkeroutput was returned for the taskcodeThe status code returned by the callr R session (integer)messageThe message returned by the callr R session (character)stdoutList column containing the contents of stdout during function executionstderrList column containing the contents of stderr during function executionerrorList column containingNULLvalues
If all tasks have completed this output is the same as the output as the
run() method for a Queue object.
Note: at present there is one field from the callr rsession::read() method
that isn't captured here, and that's the error field. I'll add that after
I've finished wrapping my head around what that actually does. The error
column, at present, is included only as a placeholder