62 $replace_thunk_values =
false;
64 if (is_a($value, ThunkValue::class)) {
65 $value = $this->
executeTask($value->getParentTask(), $observer);
66 $replace_thunk_values =
true;
68 $final_values[] = $value;
71 if ($replace_thunk_values) {
75 if (is_a($task,
Task\Job::class)) {
79 $value = $job->run($final_values, $observer);
80 if (!$value->getType()->isExtensionOf($job->getOutputType())) {
81 throw new Exception(
"The job " . $job->getType()
82 .
" did state to output a value of type " 83 . $job->getOutputType() .
" but outputted a value of type " 91 if (is_a($task,
Task\UserInteraction::class)) {
93 $userInteraction = $task;
95 if ($userInteraction->canBeSkipped($final_values)) {
105 throw new Exception(
"You need to execute a Job or a UserInteraction.");
124 $this->persistence->deleteBucket($bucket);
134 $this->persistence->deleteBucket($bucket);
continueTask(Bucket $bucket, Option $option)
Continue a task with a given option.
notifyPercentage(Task $task, $percentage)
You can change the progress of a currently running task.
executeTask(Task $task, Observer $observer)
Actually executes a task.
notifyState($state)
If the bucket goes into another state notify the observer.
__construct(Persistence $persistence)
quitBucket(Bucket $bucket)
Quits and deletes a Bucket with all it's Jobs.
userInteraction(Option $option)
Let the user interact with the bucket task queue.
notifyCurrentTask(Task $task)
If the current task changes notify the observer.
run(Bucket $bucket)
Depending on your background task settings, executes or puts the task into the queue.