/** * @return array */ public function getWorkerConfigs() { if ($this->worker_configs) { return $this->worker_configs; } $this->worker_configs = []; foreach ($this->queue_config->getQueueNames() as $queue_name) { $queue_config = $this->queue_config->getWorkerConfig($queue_name); $key_name = "{$queue_config['worker_type']}-{$queue_config['worker_name']}"; $this->worker_configs[$key_name] = ['worker_type' => $queue_config['worker_type'], 'worker_name' => $queue_config['worker_name'], 'process_count' => $queue_config['process_count'], 'command' => $this->getBinFilePath($this->worker_commands[$queue_config['worker_type']])]; } return $this->worker_configs; }
/** * @covers ::__construct * @covers ::getWorkerConfig * @covers ::<private> * @expectedException Exception */ public function testWorkerConfigForUnknownConfigThrowsAnException() { $config = new QueueConfig(['worker_queues' => []]); $config->getWorkerConfig('worker-missing'); }