Polls the Queue on Notification from IronMQ

Dispatches the `{queue}.message_received` event

@param NotificationEvent $event The Notification Event
@param string $eventName Name of the event
@param EventDispatcherInterface $dispatcher
@return void
486606
public function onNotification(NotificationEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $message = new Message(
            $event->getNotification()->getId(),
            $event->getNotification()->getBody(),
            $event->getNotification()->getMetadata()->toArray()
        );

        $this->log(
            200,
            "Message has been received from Push Notification.",
            ['message_id' => $event->getNotification()->getId()]
        );

        $messageEvent = new MessageEvent($this->name, $message);

        $dispatcher->dispatch(
            Events::Message($this->name),
            $messageEvent
        );
    }
27384
protected function runNotificationListener(string $event, array $notification)
    {
        app('events')->listen($event, function(array $variables = null, array $recipients = null) use($notification) {
            $this->eventDispatcher->run($notification, $variables, $recipients);
        });
    }
1310663
public function dispatch($eventName, Event $event = null)
    {
        if (null === $event) {
            $event = new Event();
        }

        $event->setDispatcher($this);
        $event->setName($eventName);

        if (!isset($this->listeners[$eventName])) {
            return $event;
        }

        $this->doDispatch($this->getListeners($eventName), $eventName, $event);

        return $event;
    }
1164318
final public function dispatch(Event $event): void
    {
        if (!$event instanceof ReceivedEvent && $this->discriminator->shouldEnqueue($event)) {
            $this->queue->send($event);
        }

        if ($event instanceof ReceivedEvent) {
            $event = $event->getOriginalEvent();
        }

        $this->wrappedEventBus->dispatch($event);
    }
362272
public function updateModuleHookPosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $this->genericUpdatePosition(ModuleHookQuery::create(), $event, $dispatcher);
        $this->cacheClear($dispatcher);

        return $event;
    }
89645
public function onSetStartTimeListenerRun(
        QueueSetStartTimeEvent $event,
        $eventName,
        EventDispatcherInterface $dispatcher
    ) {
        $query = $event->getQuery();
        $this->database->execute($query);
    }
1359679
public function updateContentPosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        return $this->genericUpdatePosition(ProductAssociatedContentQuery::create(), $event, $dispatcher);
    }
1170109
public function updatePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $this->genericUpdatePosition(ModuleQuery::create(), $event, $dispatcher);

        $this->cacheClear($dispatcher);
    }
651321
public function update(AttributeAvUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $attribute = AttributeAvQuery::create()->findPk($event->getAttributeAvId())) {
            $attribute
                ->setDispatcher($dispatcher)

                ->setLocale($event->getLocale())
                ->setTitle($event->getTitle())
                ->setDescription($event->getDescription())
                ->setChapo($event->getChapo())
                ->setPostscriptum($event->getPostscriptum())

                ->save();

            $event->setAttributeAv($attribute);
        }
    }
993816
public function viewCheck(ViewCheckEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if ($event->getView() == 'content') {
            $content = ContentQuery::create()
                ->filterById($event->getViewId())
                ->filterByVisible(1)
                ->count();

            if ($content == 0) {
                $dispatcher->dispatch(TheliaEvents::VIEW_CONTENT_ID_NOT_VISIBLE, $event);
            }
        }
    }
419570
protected function dispatchEvent($eventName, \Symfony\Component\EventDispatcher\Event $event)
    {
        if (!$event->isPropagationStopped()) {
            $dispatcher = $this->getEventDispatcher();
            $dispatcher->dispatch($eventName, $event);
        }
        return !$event->isPropagationStopped();
    }
1182171
public function updateAttributePosition(UpdatePositionEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $this->genericUpdatePosition(AttributeTemplateQuery::create(), $event, $dispatcher);
    }
85839
public function viewCheck(ViewCheckEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if ($event->getView() == 'brand') {
            $brand = BrandQuery::create()
                ->filterById($event->getViewId())
                ->filterByVisible(1)
                ->count();

            if ($brand == 0) {
                $dispatcher->dispatch(TheliaEvents::VIEW_BRAND_ID_NOT_VISIBLE, $event);
            }
        }
    }
1031071
public function onSetErrorListenerQuery(
        QueueSetErrorEvent $event,
        $eventName,
        EventDispatcherInterface $dispatcher
    ) {
        $table          = $event->getQueueTable();
        $field          = $event->getField();
        $id             = $event->getId();
        $query          = "UPDATE $table SET $field = 1 WHERE id = $id";
        $event->setQuery($query);
    }
1242073
public function updateSeo(UpdateSeoEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        return $this->genericUpdateSeo(ContentQuery::create(), $event, $dispatcher);
    }
942644
public function notify($eventName, array $params = array())
    {
        $this->dispatcher->notify($e = $this->createEvent($eventName, $params));
        return $e;
    }
385391
public function onAddToQueueListenerQueryWhere(AddToQueueEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $oldData        = $event->getOldData();
        $query          = $event->getQuery();
        $srctable       = $event->getSrctable();
        $srcid          = $event->getSrcid();

        if ($oldData) {
            $query .= " WHERE srctable = '$srctable' AND srcid = $srcid AND startworking = 0 AND endworking = 0";
            $event->setQuery($query);
        }
    }