Defer dispatching of an event or events until flush is called.

@param       $eventName
@param array $payload

@throws \EventDispatch\Exception\SubscriberNotCallable
972868
public function queue($eventName, $payload = array())
    {
        $me = $this;

        $this->subscribe($eventName . self::QUEUE_NAME, function () use ($me, $eventName, $payload) {
            return $me->dispatch($eventName, $payload);
        });
    }
787668
public function event($eventName, array $payload)
    {
        $topic = getenv('MULTICAST_TOPIC_NAME') ? getenv('MULTICAST_TOPIC_NAME') : 'multicast_event';

        $this->producer = $this->eventProducer->setTargetServiceName($this->namespace . '.' . $topic);

        $this->send($eventName, $payload);

        return $this;
    }
774271
protected function afterDispatch(string $eventName, $event)
    {
        $this->postDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
    }
660872
public function broadcast(array $channels, $event, array $payload = [])
    {


        $socket = Arr::pull($payload, 'socket');

        $payload = [
            'event' => $event, 'data' => $payload, 'socket' => $socket,
        ];

        foreach ($this->formatChannels($channels) as $channel) {
            LaravooleFacade::task(['channel' => $channel, 'payload' => $payload]);
        }
    }
694486
public function recordEvent($eventName, $payload)
    {
        if (! Telescope::isRecording() || $this->shouldIgnore($eventName)) {
            return;
        }

        $formattedPayload = $this->extractPayload($eventName, $payload);

        Telescope::recordEvent(IncomingEntry::make([
            'name' => $eventName,
            'payload' => empty($formattedPayload) ? null : $formattedPayload,
            'listeners' => $this->formatListeners($eventName),
            'broadcast' => class_exists($eventName)
                        ? in_array(ShouldBroadcast::class, (array) class_implements($eventName))
                        : false,
        ])->tags(class_exists($eventName) && isset($payload[0]) ? ExtractTags::from($payload[0]) : []));
    }
226813
protected function handle(ConnectionInterface $connection, Payload $payload)
    {
        switch ($payload->getEvent()) {
            case ConnectionEvent::SOCKET_AUTH_REQUEST:
                $this->handleAuthentication($connection, $payload);
                break;
            default:
                $this->eventDispatcher->dispatch($payload->getEvent(), new ConnectionEvent($connection, $payload));
                $this->logger->notice(sprintf('Dispatched event: %s', $payload->getEvent()));
        }
    }
272533
public static function dispatch(string $className, object $object = null) : void
    {
        /** @var EventInterface $className */
        static::eventClassCheck($className);
        $className::dispatch($object);
    }
1051917
public function onData(Payload $payload)
    {
        $this->received[] = $payload;
        if (($callback = $this->options['on_data_callback'])) {
            call_user_func($callback, $payload);
        }
    }
1085170
protected function lazyLoad($eventName)
    {
        parent::lazyLoad($eventName);

        if (isset($this->listenerIds[$eventName])) {
            foreach ($this->listenerIds[$eventName] as $args) {
                list($serviceId, $method, $priority, $queueName) = $args;
                if ($queueName != null) {
                    $listener = $this->container->get($serviceId);
                    $key = $serviceId.'.'.$method;
                    $this->listeners[$eventName][$key] = array($listener, $queueName);
                }
            }
        }
    }
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;
    }
861828
public function pushRaw($payload, $queueName )
    {
        $this->__handler->rPush($queueName, $payload);

        return Arr::get(json_decode($payload, true), 'id');
    }
1214051
@Override
  public void eventReceived(EventSubscriptionEntity eventSubscriptionEntity, Object payload, boolean processASync) {
    if (processASync) {
      scheduleEventAsync(eventSubscriptionEntity, payload);
    } else {
      processEventSync(eventSubscriptionEntity, payload);
    }
  }
979270
protected function fireEvent($event, $payload = [ ], $halt = false)
    {
        if (! isset($this->dispatcher)) {
            $this->initEventDispatcher();
        }

        $dispatcher = $this->dispatcher;
        $status     = $this->dispatcherStatus;
        if (! $dispatcher || $status === false) {
            return;
        }
        $method = $halt ? 'until' : 'fire';

        return $dispatcher->{$method}($event, $payload);
    }
137661
public void cancel(final String eventName) {

        BurstEvent oe = m_memory.remove(eventName);
        if (oe != null) {
            // disable the old event.
            oe.getTimer().cancel();
        }
    }
521539
public function dispatch($eventName, $params)
    {
        $event = new DedicatedEvent();
        $event->setParameters($params);
        $this->symfonyEventDispatcher->dispatch("maniaplanet.game.".$eventName, $event);
    }
818004
public function fire($event, $payload=[], $halt=false)
    {
        return $this->dispatcher->fire($event, $payload, $halt);
    }
609789
protected function dispatch(string $eventName, DomainEvent $event): void
    {
        $listeners = $this->dispatcher->getListeners($eventName);

        if (!empty($listeners)) {
            $this->doDispatch($listeners, $eventName, $event);
        }
    }