Skip to content

Task dependencies

mtwebit edited this page Jul 6, 2018 · 2 revisions

You can specify execution dependencies between tasks.

A task wants another task to be finished

Simply add a 'dep' field to $taskData when creating the task:

$taskData['dep'] = $othertask;
$task = $tasker->createTask($class, $method, $page, 'This task depends on '.$othertask->title, $taskData);

or add a dependency later on:

$tasker->addDependency($task, $otherTask);

Dependencies are automatically handled by Tasker. You cannot activate a task when they are not met.

Execute another task when the task is finished

It is also possible to specify follow-up tasks that will be activated when the task is finished.

$tasker->addNextTask($task, $nextTask);

Follow-up tasks (IDs) are stored in $taskData['next_task'].

Clone this wiki locally