/** * @param QueueInterface $queue * @return MessageServiceInterface */ public function dispatch(QueueInterface $queue) { while ($message = $queue->dequeue()) { $this->publish($message); } return $this; }
/** * @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]); } }
public function delete(QueueInterface $queue) { if (isset(self::$registry[$queue->getId()])) { unset(self::$registry[$queue->getId()]); } }