예제 #1
0
 /**
  * @param Message     $message
  * @param string|null $queueName
  */
 public function produce(Message $message, $queueName = null)
 {
     $queueName = $queueName ?: Util::guessQueue($message);
     $queue = $this->queues->create($queueName);
     $queue->enqueue($envelope = new Envelope($message));
     $this->dispatcher->dispatch('bernard.produce', new EnvelopeEvent($envelope, $queue));
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function getQueue()
 {
     return Util::guessQueue($this);
 }