/** * On dispatch event listener - called on any event * * @param Event $event * @param string $eventName * @return void */ public function onException(Event $event, $eventName) { if ($event instanceof Amqp\ErrorEvent) { $event->getEvent()->addHeader("x-exception", ["message" => $event->getException()->getMessage(), "code" => $event->getException()->getCode(), "class" => get_class($event->getException())]); $this->deadLetter($event->getEvent(), $event->getException()); $event->getEvent()->reject(null); if ($this->stopPropagation) { $event->stopPropagation(); } } }
/** * On dispatch event listener - called on any event * * @param Event $event * @param string $eventName * @return void */ public function onException(Event $event) { if ($event instanceof Amqp\ErrorEvent) { $event->getEvent()->addHeader("x-exception", ["message" => $event->getException()->getMessage(), "code" => $event->getException()->getCode(), "class" => get_class($event->getException())]); $this->postpone($event->getEvent()); $event->getEvent()->ack(); if ($this->stopPropagation) { $event->stopPropagation(); } } }
public function onEventCreate(\Symfony\Component\EventDispatcher\Event $event) { $koalamonEvent = $event->getEvent(); if ($event->hasLastEvent()) { if ($this->isNotifiable($koalamonEvent, $event->getLastEvent())) { $this->notify($koalamonEvent); } } else { if ($this->isNotifiable($koalamonEvent)) { $this->notify($koalamonEvent); } } }
public function onEventCreate(\Symfony\Component\EventDispatcher\Event $event) { $koalamonEvent = $event->getEvent(); /** @var Event $koalamonEvent */ $this->notify($koalamonEvent, $event->getLastEvent()); }