1 | <?php |
||
20 | class WorkerRunnerManager |
||
21 | { |
||
22 | /** |
||
23 | * Worker runner services configuration. |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | private $runners = array(); |
||
28 | |||
29 | /** |
||
30 | * Container. |
||
31 | * |
||
32 | * @var ContainerInterface |
||
33 | */ |
||
34 | private $container; |
||
35 | |||
36 | 6 | public function __construct(ContainerInterface $container) |
|
40 | |||
41 | /** |
||
42 | * Register runner service. |
||
43 | * |
||
44 | * @param string $id Service ID. |
||
45 | * @param string $name Worker name. |
||
46 | * @param array $options Worker options. |
||
47 | * @throws InvalidArgumentException Thrown, when there is no worker runner service registered in container. |
||
48 | */ |
||
49 | 4 | public function addRunner($id, $name, array $options = array()) |
|
59 | |||
60 | 5 | public function has($name) |
|
64 | |||
65 | 3 | public function run($name, OutputInterface $output = null) |
|
74 | |||
75 | } |
||
76 |