ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
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
use
ILIAS\BackgroundTasks\Task\UserInteraction
;
11
28
class
SyncTaskManager
extends
BasicTaskManager
29
{
30
34
protected
$persistence
;
35
36
37
public
function
__construct
(
Persistence
$persistence
)
38
{
39
$this->persistence =
$persistence
;
40
}
41
42
52
public
function
run
(
Bucket
$bucket)
53
{
54
$task = $bucket->
getTask
();
55
$bucket->
setCurrentTask
($task);
56
$observer =
new
NonPersistingObserver
($bucket);
57
58
try
{
59
$task = $this->
executeTask
($task, $observer);
60
if
($task instanceof
UserInteraction
&& $task->
canBeSkipped
($task->getInput())) {
61
throw
new
UserInteractionSkippedException
(
'can be skipped'
);
62
}
63
$bucket->
setState
(
State::FINISHED
);
64
}
catch
(
UserInteractionSkippedException
$e
) {
65
$bucket->
setState
(
State::FINISHED
);
66
}
catch
(
UserInteractionRequiredException
$e) {
67
// We're okay!
68
$this->persistence->saveBucketAndItsTasks($bucket);
69
}
70
}
71
}
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
Vendor\Package\$e
$e
Definition:
example_cleaned.php:31
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:34
ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager
Definition:
SyncTaskManager.php:28
ILIAS\BackgroundTasks\Implementation\Tasks\UserInteraction\UserInteractionRequiredException
Definition:
UserInteractionRequiredException.php:7
Bucket
ILIAS\BackgroundTasks\Task\UserInteraction\canBeSkipped
canBeSkipped(array $input)
Decide whether the UserInteraction is presented to the user and he has to decide or user UserInteract...
ILIAS\BackgroundTasks\Implementation\Tasks\UserInteraction\UserInteractionSkippedException
Definition:
UserInteractionSkippedException.php:7
ILIAS\BackgroundTasks\Task\UserInteraction
Definition:
Option.php:3
ILIAS\BackgroundTasks\Task\UserInteraction
Definition:
UserInteraction.php:17
ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager\__construct
__construct(Persistence $persistence)
Definition:
SyncTaskManager.php:37
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:52
ILIAS\BackgroundTasks\Implementation\TaskManager\BasicTaskManager
Definition:
BasicTaskManager.php:34
Persistence
ILIAS\BackgroundTasks\Implementation\TaskManager
Definition:
AsyncTaskManager.php:3
src
BackgroundTasks
Implementation
TaskManager
SyncTaskManager.php
Generated on Thu Apr 3 2025 21:01:34 for ILIAS by
1.8.13 (using
Doxyfile
)