ILIAS  release_8 Revision v8.24
NonPersistingObserver.php
Go to the documentation of this file.
1<?php
2
20
24
31{
32 protected \ILIAS\BackgroundTasks\Bucket $bucket;
33
34 public function __construct(Bucket $bucket)
35 {
36 $this->bucket = $bucket;
37 }
38
42 public function notifyState(int $state): void
43 {
44 $this->bucket->heartbeat();
45 $this->bucket->setState($state);
46 }
47
48 public function notifyPercentage(Task $task, int $percentage): void
49 {
50 $this->bucket->heartbeat();
51 $this->bucket->setPercentage($task, $percentage);
52 }
53
54 public function notifyCurrentTask(Task $task): void
55 {
56 $this->bucket->heartbeat();
57 $this->bucket->setCurrentTask($task);
58 }
59
64 public function heartbeat(): void
65 {
66 $this->bucket->heartbeat();
67 }
68}
notifyPercentage(Task $task, int $percentage)
You can change the progress of a currently running task.
notifyCurrentTask(Task $task)
If the current task changes notify the observer.
heartbeat()
I'm still alive! If your calculation takes a really long time don't forget to use the heartbeat.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Job.php:19