| 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 | public function __construct(LoopInterface $loop) |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param TaskInterface $task |
||
| 38 | * |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | public function add(TaskInterface $task): bool |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param TaskInterface $task |
||
| 53 | * |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | public function remove(TaskInterface $task): bool |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @param TaskInterface $task |
||
| 68 | * |
||
| 69 | * @return bool |
||
| 70 | */ |
||
| 71 | public function exists(TaskInterface $task): bool |
||
| 75 | |||
| 76 | public function runTasks() |
||
| 92 | } |