Example #1
0
 /**
  * {@inheritdoc}
  */
 public function dispatchNow(MessageInterface $message)
 {
     if ($this->gate->has(BusInterface::SYSTEM_BUS)) {
         $this->dispatchSystemMessage($message);
     }
     return $this->bus->dispatchNow($message);
 }
Example #2
0
 /**
  * Assert valid system bus.
  *
  * @param BusInterface $bus
  */
 private function assertValidSystemBus(BusInterface $bus)
 {
     if (false === $bus instanceof SystemBus) {
         throw new InvalidArgumentException(sprintf('Bus with name "%s" reserved for system bus.', $bus->getName()));
     }
 }