ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PersistingObserver.php
Go to the documentation of this file.
1 <?php
2 
4 
9 
17 class PersistingObserver implements Observer
18 {
19  protected $bucket;
20  protected $persistence;
21 
22 
24  {
25  $this->bucket = $bucket;
26  $this->persistence = $persistence;
27  }
28 
29 
34  public function notifyState($state)
35  {
36  $this->bucket->setState($state);
37  $this->bucket->heartbeat();
38  $this->persistence->updateBucket($this->bucket);
39  }
40 
41 
47  public function notifyPercentage(Task $task, $percentage)
48  {
49  $this->bucket->setPercentage($task, $percentage);
50  $this->bucket->heartbeat();
51  $this->persistence->updateBucket($this->bucket);
52  }
53 
54 
58  public function notifyCurrentTask(Task $task)
59  {
60  $this->bucket->setCurrentTask($task);
61  $this->bucket->heartbeat();
62  $this->persistence->updateBucket($this->bucket);
63  }
64 
65 
72  public function heartbeat()
73  {
74  $this->bucket->heartbeat();
75  $this->persistence->updateBucket($this->bucket);
76  }
77 }
if(!array_key_exists('stateid', $_REQUEST)) $state
Handle linkback() response from LinkedIn.
Definition: linkback.php:10
heartbeat()
I&#39;m still alive! If your calculation takes a really long time don&#39;t forget to use the heartbeat...