61 $replace_thunk_values =
false;
62 foreach ($values as $value) {
63 if (is_a($value, ThunkValue::class)) {
64 $value = $this->
executeTask($value->getParentTask(), $observer);
65 $replace_thunk_values =
true;
67 $final_values[] = $value;
70 if ($replace_thunk_values) {
74 if (is_a($task,
Task\Job::class)) {
78 $value = $job->run($final_values, $observer);
79 if (!$value->getType()->isExtensionOf($job->getOutputType())) {
80 throw new Exception(
"The job " . $job->getType()
81 .
" did state to output a value of type " 82 . $job->getOutputType() .
" but outputted a value of type " 90 if (is_a($task,
Task\UserInteraction::class)) {
92 $userInteraction = $task;
98 throw new Exception(
"You need to execute a Job or a UserInteraction.");
122 $this->persistence->saveBucketAndItsTasks($bucket);
142 $this->persistence->deleteBucket($bucket);
152 $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.
Class NonPersistingObserver.
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.
run(Bucket $bucket)
This will add an Observer of the Task and start running the task.
userInteraction(Option $option)
Let the user interact with the bucket task queue.
notifyCurrentTask(Task $task)
If the current task changes notify the observer.