The type of the task worker parameters.
The type of the task worker result.
The type of the task worker parameters.
The type of the task worker result.
The configuration options for the group task.
If no configuration is set.
If invalid mode is set.
If subtasks array is empty.
Gets the group task mode.
The group task mode.
Sets the group task mode.
The group task mode.
Gets the task worker result.
The task worker result.
Internal
Sets the task worker result.
The task worker result.
Gets the group sub tasks.
The group sub tasks.
Sets the group sub tasks.
The group sub tasks.
Gets the group task type.
The group task type.
Will be removed in next major release. Use GroupTask.mode instead.
Sets the group task type.
The group task type.
Will be removed in next major release. Use GroupTask.mode instead.
Gets the task worker function.
The task worker function.
Sets the task worker function.
The task worker function.
Gets the task worker parameters.
The task worker parameters.
Sets the task worker parameters.
The task worker parameters.
Executes the group task.
The fallback task configuration.
The task worker result.
All sub tasks must have a worker function and worker parameters defined at the time of execution.
If any of the sub task have undefined worker function or worker parameters, then it should be set or it will use group task's worker function and worker parameters if defined, or fallback configuration can be provided to use for the execution, else it will throw an error.
Fallback configuration does not set the worker function or worker parameters of the group task or its sub tasks but only provides the temporary values to fallback on.
If even fallback values are undefined, then sub task throws an error.
Without fallback configuration.
groupTask.execute();
// will run successfully if subtask.worker and subtask.workerParams are not undefined or
// groupTask.worker and groupTask.workerParams are defined for fallback
With a fallback worker function.
groupTask.execute({ worker: (a, b) => a - b });
// fallback worker function will be used only if subtask.worker and groupTask.worker are
// undefined
// will run successfully if subtask.workerParams is not undefined or
// groupTask.workerParams is defined for fallback
With fallback worker parameters.
groupTask.execute({ worker: (a, b) => a - b });
// fallback worker parameters will be used only if subtask.workerParams and
// groupTask.workerParams are undefined
// will run successfully if subtask.worker is not undefined or
// groupTask.worker is defined for fallback
With both fallback worker and worker parameters.
task.execute({ worker: (a, b) => a - b, workerParams: [3, 4] });
// fallback worker function will be used only if subtask.worker and groupTask.worker are
// undefined
// fallback worker parameters will be used only if subtask.workerParams and
// groupTask.workerParams are undefined
// will run successfully even if subtask.worker, subtask.workerParams, groupTask.worker,
// and groupTask.workerParams are undefined
Generated using TypeDoc
GroupTask class represents a kind of task which on execution runs its sub tasks in a defined mode.
Remarks
It must have the execution mode (or type, deprecated) and sub tasks defined in its configuration. It can optionally have a worker function and worker parameters in its configuration. It has an execute method which is used to run its sub tasks and store their results.
It can be a sub task of a group task.
Example
Group task with only required configuration.
Example
GroupTask with optional worker function and worker parameters.