Stores a reference to the event queue for the connection on which a USER
event occurs.

@param \Phergie\Irc\EventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue
496240
public function setEventQueue(Event $event, Queue $queue)
    {
        $mask = $this->getConnectionMask($event->getConnection());
        $this->getEventQueueDeferred($mask)->resolve($queue);
    }
1296190
public function handleQuitCommand(CommandEvent $event, EventQueueInterface $queue)
    {
        $message = sprintf($this->message, $event->getNick());
        $queue->ircQuit($message);
    }
416552
protected function sendHelpReply(Event $event, Queue $queue, array $messages)
    {
        $method = 'irc' . $event->getCommand();
        $target = $event->getSource();
        foreach ($messages as $message) {
            $queue->$method($target, $message);
        }
    }
26103
public function queueEvent($event)
    {
        $this->queue->enqueue($event);

        $class = get_class($event);
        foreach ($this->synchronousEventMap->getListenersForEvent($class) as $listener)
        {
            $this->invokeListener($listener, $event);
        }
    }
968793
public function handleNoticeCommand(Event $event, Queue $queue)
    {
        $params = $event->getCustomParams();
        if (count($params) < 2) {
            $this->handleNoticeHelp($event, $queue);
        } else {
            $channels = array_shift($params);
            $queue->ircNotice($channels, implode(' ', $params));
        }
    }
692222
public function add(EventInterface $event)
    {
        $index = $this->computeIndex($event);
        if (isset($this->events[$index])) {
            $this->events[$index][] = $event;
        } else {
            $this->events[$index] = array($event);
        }

        ++$this->count;
    }
675398
public function handleJoinCommand(CommandEvent $event, EventQueueInterface $queue)
    {
        $params = $event->getCustomParams();
        if (!$params) {
            $this->handleJoinHelp($event, $queue);
        } else {
            $channels = $params[0];
            $keys = isset($params[1]) ? $params[1] : null;
            $queue->ircJoin($channels, $keys);
        }
    }
350769
public function removeUser(UserEventInterface $event, EventQueueInterface $queue)
    {
        $logger = $this->getLogger();
        $logger->debug('Removing user from all channels');
        $connectionMask = $this->getConnectionMask($event->getConnection());
        if (isset($this->modes[$connectionMask])) {
            $this->removeUserData(
                $connectionMask,
                array_keys($this->modes[$connectionMask]),
                $event->getNick()
            );
        }
    }
775270
public function save(EventInterface $event)
    {
        $this->events[(string) $event->uuid()][] = new $event(
            $event->uuid(),
            $event->type(),
            $event->body(),
            $this->count($event->uuid()),
            $event->occurredOn()->format('Y-m-d H:i:s.u')
        );
    }
248731
public function handleSayCommand(Event $event, Queue $queue)
    {
        $params = $event->getCustomParams();
        if (count($params) < 2) {
            $this->handleSayHelp($event, $queue);
        } else {
            $channels = array_shift($params);
            $queue->ircPrivmsg($channels, implode(' ', $params));
        }
    }
901792
public function dispatch(EventInterface $event)
    {
        if (array_key_exists($event->getName(), $this->listeners)) {
            foreach ($this->listeners[$event->getName()] as $listener) {
                $listener($event);
            }
        }

        return $event;
    }
816586
public function handleCommandHelp(Event $event, Queue $queue)
    {
        foreach ($this->getHelpLines() as $helpLine) {
            $queue->ircPrivmsg($event->getSource(), $helpLine);
        }
    }
1081516
public function onAddToQueueListenerQueryKind(AddToQueueEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $table          = $event->getQueueTable();
        $oldData        = $event->getOldData();

        if ($oldData) {
            $event->setQuery("UPDATE $table SET ");
        } else {
            $event->setQuery("INSERT INTO $table SET ");
        }
    }
375875
public function handle(EventInterface $event)
    {

        try {
            // load the application server instance
            /** @var \AppserverIo\Psr\ApplicationServer\ApplicationServerInterface $applicationServer */
            $applicationServer = $this->getApplicationServer();

            // write a log message that the event has been invoked
            $applicationServer->getSystemLogger()->info($event->getName());

            // and initialize a console for each node found in the configuration
            /** @var \AppserverIo\Psr\Cli\Configuration\ConsoleConfigurationInterface $consoleNode */
            foreach ($applicationServer->getSystemConfiguration()->getConsoles() as $consoleNode) {
                /** @var \AppserverIo\Appserver\Core\Interfaces\ConsoleFactoryInterface $consoleFactory */
                $consoleFactory = $consoleNode->getFactory();

                // use the factory if available
                /** @var \AppserverIo\Appserver\Core\Interfaces\ConsoleInterface $console */
                $console = $consoleFactory::factory($applicationServer, $consoleNode);

                // register the console as service
                $applicationServer->bindService(ApplicationServerInterface::ADMINISTRATION, $console);
            }

        } catch (\Exception $e) {
            $applicationServer->getSystemLogger()->error($e->__toString());
        }
    }
816510
public function put(EventInterface $event) {
        $request = $event->getRequest();
        $metadata = json_decode($request->getContent(), true);

        $event->getManager()
            ->trigger('db.metadata.delete')
            ->trigger('db.metadata.update', [
                'metadata' => $metadata,
            ]);

        $model = new Model\Metadata();
        $model->setData($metadata);

        $event->getResponse()->setModel($model);
    }
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);
    }
1340730
public function handle(EventInterface $event): void
    {
        if ($this->queue === null) {
            throw new \RuntimeException('Property PublishToQueueListener::queue must be set');
        }

        try {
            $message = $this->createMessage($event);
            $this->getChannel()->basic_publish($message, '', $this->queue);
        } catch (InvalidConfigException $exception) {
            $this->logger->critical($exception->getMessage());
        }
    }