1 | <?php |
||
14 | class WorkerRunnerManager |
||
15 | { |
||
16 | /** |
||
17 | * Worker runner services configuration. |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | private $runners = array(); |
||
22 | |||
23 | /** |
||
24 | * Container. |
||
25 | * |
||
26 | * @var ContainerInterface |
||
27 | */ |
||
28 | private $container; |
||
29 | |||
30 | public function __construct(ContainerInterface $container) |
||
34 | |||
35 | /** |
||
36 | 7 | * Register runner service. |
|
37 | * |
||
38 | 7 | * @param string $name Worker name. |
|
39 | 7 | * @param string $id Service ID. |
|
40 | * @param array $options Worker options. |
||
41 | * @throws InvalidArgumentException Thrown, when there is no worker runner service registered in container. |
||
42 | */ |
||
43 | public function addRunnerService($name, $id, array $options = array()) |
||
53 | |||
54 | 5 | public function has($name) |
|
58 | 5 | ||
59 | public function run($name, OutputInterface $output = null) |
||
68 | 1 | ||
69 | /** |
||
70 | * Get registered runners. |
||
71 | 2 | * |
|
72 | 2 | * @return string[] |
|
73 | 2 | */ |
|
74 | public function getRunners() |
||
78 | |||
79 | } |
||
80 |