Example #1
0
 /**
  * @param QueueInterface $queue
  * @return MessageServiceInterface
  */
 public function dispatch(QueueInterface $queue)
 {
     while ($message = $queue->dequeue()) {
         $this->publish($message);
     }
     return $this;
 }
Example #2
0
 /**
  * @param QueueInterface $queue
  * @param $specification
  */
 public function unbind(QueueInterface $queue, SpecificationInterface $specification = null)
 {
     if (null === $specification) {
         if (isset($this->queues[$queue->getId()])) {
             unset($this->queues[$queue->getId()]);
         }
         if (isset($this->specifications[$queue->getId()])) {
             unset($this->specifications[$queue->getId()]);
         }
     } elseif (isset($this->specifications[$queue->getId()][(string) $specification])) {
         unset($this->specifications[$queue->getId()][(string) $specification]);
     }
 }
Example #3
0
 public function delete(QueueInterface $queue)
 {
     if (isset(self::$registry[$queue->getId()])) {
         unset(self::$registry[$queue->getId()]);
     }
 }