1 | <?php |
||
14 | class TaskController |
||
15 | { |
||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | protected $loopInterval = 1; |
||
|
|||
20 | |||
21 | /** |
||
22 | * @var TaskInterface[] |
||
23 | */ |
||
24 | protected $tasks = []; |
||
25 | |||
26 | /** |
||
27 | * TaskController constructor. |
||
28 | * |
||
29 | * @param LoopInterface $loop |
||
30 | */ |
||
31 | 9 | public function __construct(LoopInterface $loop) |
|
35 | |||
36 | /** |
||
37 | * @param TaskInterface $task |
||
38 | * |
||
39 | * @return bool |
||
40 | */ |
||
41 | 9 | public function add(TaskInterface $task): bool |
|
50 | |||
51 | /** |
||
52 | * @param TaskInterface $task |
||
53 | * |
||
54 | * @return bool |
||
55 | */ |
||
56 | 8 | public function remove(TaskInterface $task): bool |
|
65 | |||
66 | 1 | public function removeAll() |
|
74 | |||
75 | /** |
||
76 | * @param TaskInterface $task |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | 9 | public function exists(TaskInterface $task): bool |
|
84 | |||
85 | 6 | public function runTasks() |
|
101 | } |