Ejemplo n.º 1
0
 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'));
 }
Ejemplo n.º 2
0
 /**
  * @covers Gloubster\AMQP\Factory::createAMQPLibConnection
  */
 public function testCreateConnectedConnection()
 {
     $connection = Factory::createAMQPLibConnection($this->configuration);
     $this->assertInstanceOf('PhpAmqpLib\\Connection\\AMQPConnection', $connection);
 }