Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function publish(string $message, string $routingKey = '', int $flags = Constants::AMQP_NOPARAM, array $attributes = [])
 {
     $attributes['user_id'] = $this->getConnection()->getOptions()->getLogin();
     $message = new AMQPMessage($message, $attributes);
     if (isset($attributes['headers'])) {
         $message->set('application_headers', new AMQPTable($attributes['headers']));
     }
     $this->channel->getResource()->basic_publish($message, $this->name, $routingKey, (bool) ($flags & Constants::AMQP_MANDATORY), (bool) ($flags & Constants::AMQP_IMMEDIATE), null);
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function delete(int $flags = Constants::AMQP_NOPARAM)
 {
     $this->channel->getResource()->queue_delete($this->name, (bool) ($flags & Constants::AMQP_IFUNUSED), (bool) ($flags & Constants::AMQP_IFEMPTY), (bool) ($flags & Constants::AMQP_NOWAIT), null);
 }