コード例 #1
0
 /**
  * Create service with name
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @param string $name
  * @param string $requestedName
  * @return AMQPConnection
  */
 public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
 {
     $config = $this->getConfig($serviceLocator);
     $options = new ConnectionOptions($config[$this->subConfigKey][$requestedName]);
     $connection = new AMQPConnection($options->toArray());
     if ($options->getPersistent()) {
         $connection->persistent = true;
     }
     return $connection;
 }