Example #1
0
 /**
  * Publishes an event to the stream
  *
  * @param Event $event the event to publish
  *
  * @return boolean true if the event was published, otherwise false
  */
 public function publish(Event $event)
 {
     $exchange = $this->getAmqpClient()->getExchanges()->itemAt(get_class($event->sender));
     $exchange->send($event->toJSON());
 }
Example #2
0
 /**
  * Publishes an event to the stream
  *
  * @param Event $event the event to publish
  *
  * @return boolean true if the event was published, otherwise false
  */
 public function publish(Event $event)
 {
     $json = json_encode($event->toJSON());
     return $this->getChannel(get_class($event->sender))->publish($json);
 }