ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
SyncTaskManager.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
ILIAS\BackgroundTasks\Implementation\TaskManager
;
4
5
use
ILIAS\BackgroundTasks\Bucket
;
6
use
ILIAS\BackgroundTasks\Implementation\Bucket\State
;
7
use
ILIAS\BackgroundTasks\Implementation\Tasks\UserInteraction\UserInteractionRequiredException
;
8
use
ILIAS\BackgroundTasks\Implementation\Tasks\UserInteraction\UserInteractionSkippedException
;
9
use
ILIAS\BackgroundTasks\Persistence
;
10
27
class
SyncTaskManager
extends
BasicTaskManager
28
{
29
33
protected
$persistence
;
34
35
36
public
function
__construct
(
Persistence
$persistence
)
37
{
38
$this->persistence =
$persistence
;
39
}
40
41
51
public
function
run
(
Bucket
$bucket)
52
{
53
$task = $bucket->
getTask
();
54
$bucket->
setCurrentTask
($task);
55
$observer =
new
NonPersistingObserver
($bucket);
56
57
try
{
58
$this->
executeTask
($task, $observer);
59
$bucket->
setState
(
State::FINISHED
);
60
}
catch
(
UserInteractionSkippedException
$e) {
61
$bucket->
setState
(
State::FINISHED
);
62
}
catch
(
UserInteractionRequiredException
$e) {
63
// We're okay!
64
$this->persistence->saveBucketAndItsTasks($bucket);
65
}
66
}
67
}
ILIAS\BackgroundTasks\Persistence
Definition:
Persistence.php:11
ILIAS\BackgroundTasks\TaskManager\executeTask
executeTask(Task $task, Observer $observer)
Actually executes a task.
UserInteractionRequiredException
ILIAS\BackgroundTasks\Implementation\Bucket\State\FINISHED
const FINISHED
Definition:
State.php:23
ILIAS\BackgroundTasks\Bucket
Definition:
Bucket.php:15
ILIAS\BackgroundTasks\Bucket\setCurrentTask
setCurrentTask($task)
ILIAS\BackgroundTasks\Bucket\setState
setState($state)
State
ILIAS\BackgroundTasks\Implementation\TaskManager\NonPersistingObserver
Class NonPersistingObserver.
Definition:
NonPersistingObserver.php:16
UserInteractionSkippedException
ILIAS\BackgroundTasks\Bucket\getTask
getTask()
ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager\$persistence
$persistence
Definition:
SyncTaskManager.php:33
ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager
Definition:
SyncTaskManager.php:27
ILIAS\BackgroundTasks\Implementation\Tasks\UserInteraction\UserInteractionRequiredException
Definition:
UserInteractionRequiredException.php:7
Bucket
ILIAS\BackgroundTasks\Implementation\Tasks\UserInteraction\UserInteractionSkippedException
Definition:
UserInteractionSkippedException.php:7
ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager\__construct
__construct(Persistence $persistence)
Definition:
SyncTaskManager.php:36
ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager\run
run(Bucket $bucket)
This will add an Observer of the Task and start running the task.
Definition:
SyncTaskManager.php:51
ILIAS\BackgroundTasks\Implementation\TaskManager\BasicTaskManager
Definition:
BasicTaskManager.php:34
php
Persistence
ILIAS\BackgroundTasks\Implementation\TaskManager
Definition:
AsyncTaskManager.php:3
src
BackgroundTasks
Implementation
TaskManager
SyncTaskManager.php
Generated on Thu Jan 16 2025 19:02:36 for ILIAS by
1.8.13 (using
Doxyfile
)