public function execute(InputInterface $input, OutputInterface $output) { $conn = AMQPFactory::createAMQPLibConnection($this->conf); $type = $input->getArgument('type'); $id = $input->getArgument('id') ?: $this->generateId($type); $output->writeln(sprintf("Running %s worker #%s ...", $type, $id)); $worker = Factory::createWorker($type, $id, $conn, $this->conf, new TemporaryFilesystem(), $this->logger); if (0 < (int) $input->getOption('timeout')) { $worker->setTimeout($input->getOption('timeout')); } $worker->run($input->getOption('iterations')); }
/** * @covers Gloubster\AMQP\Factory::createAMQPLibConnection */ public function testCreateConnectedConnection() { $connection = Factory::createAMQPLibConnection($this->configuration); $this->assertInstanceOf('PhpAmqpLib\\Connection\\AMQPConnection', $connection); }