Dispatches the given event to handlers
which have been registered for this type of event.

\param Erebot::Interfaces::Event::Base::Generic $event
An event to dispatch.
194313
protected function dispatchEvent(\Erebot\Interfaces\Event\Base\Generic $event)
    {
        $logger = \Plop\Plop::getInstance();
        $logger->debug(
            $this->bot->gettext('Dispatching "%(type)s" event.'),
            array('type' => get_class($event))
        );
        try {
            foreach ($this->events as $handler) {
                if ($handler->handleEvent($event) === false) {
                    break;
                }
            }
        } catch (\Erebot\ErrorReportingException $e) {
            // This should help make the code a little more "bug-free" (TM).
            $logger->exception($this->bot->gettext('Code is not clean!'), $e);
            $this->disconnect($e->getMessage());
        }
    }
684190
function byEvent($event)
    {
        if (! $this->has($event) ) {
            if ($event instanceof iEvent)
                $this->bind($event);
            else 
                throw new \Exception("Events ({$event}) not found.");
        }

        $event = ($event instanceof iEvent) ? $event->getName() : $event;
        /** @var iEvent $event */
        $event = $this->attached_events[$event];
        if ($this->meeter)
            // Use Same Meeter For Bind Events
            $event->setMeeter($this->meeter);

        return $event;
    }
925284
def dispatch(self, event):
        

        for event_types, queues in self.queues.items():
            if event.type & event_types:
                for queue in queues:
                    queue.put(event)
744599
protected static function registerObservableEvent(string $event, $callback): void
    {
        if (! isset(static::$dispatcher)) {
            return;
        }

        $event = (new static())->getObservableKey($event);

        static::$dispatcher->listen("{$event}: ".static::class, $callback);
    }
415008
public function dispatch($eventName, Event $event)
    {
        if (!$this->hasListeners($eventName)) {
            return $event;
        }

        // setting event name
        $event->setName($eventName);

        // execute all callbacks for a event given
        foreach ($this->getListeners($event->getName()) as $listener) {
            call_user_func($listener, $event);

            if ($event->isPropagationStopped()) {
                break;
            }
        }

        return $event;
    }
484007
public function dispatch($eventName, Event $event = null)
    {
        $this->lazyLoad($eventName);

        return parent::dispatch($eventName, $event);
    }
1114563
public function dispatch($event/*, string $eventName = null*/)
    {
        $eventName = 1 < \func_num_args() ? \func_get_arg(1) : null;

        if (\is_object($event)) {
            $eventName = $eventName ?? \get_class($event);
        } else {
            @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), E_USER_DEPRECATED);
            $swap = $event;
            $event = $eventName ?? new Event();
            $eventName = $swap;

            if (!$event instanceof Event) {
                throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of %s, %s given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event)));
            }
        }

        if (null !== $this->optimized && null !== $eventName) {
            $listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName));
        } else {
            $listeners = $this->getListeners($eventName);
        }

        if ($listeners) {
            $this->callListeners($listeners, $eventName, $event);
        }

        return $event;
    }
1147922
private function dispatchEvent($event, $args = null)
    {
        return $this->onEventEmitterEnabled(function ($emitter) use($event, $args) {
            return $emitter->emit($event, ! is_array($args) ? [$args] : $args);
        });
    }
666787
final protected static function triggerEvent($event, array $context = array())
	{
		if (array_key_exists($event, static::$registered_events)) {
			array_map(function($handler) use ($context)
			{
				call_user_func($handler, $context);
			}, static::$registered_events[$event]);
		}
	}
434527
public function dispatchEvent($event, ...$arguments)
    {
        $this->dispatchEventToEventCallbacks($event, $arguments);

        $this->dispatchEventToEventHandler($event, $arguments);
    }
119168
public function runHandler(Event $event)
    {
        if (is_callable($this->handler)) {
            return call_user_func($this->handler, $event);
        }
        return false;
    }
46768
private function applyRegistrationCallbacks(Event $event)
    {
        foreach ($this->registrationCallbacks as $callback) {
            $event = $callback->onEventRegistration($event);
        }

        return $event;
    }
112681
public function dispatch($event, $options)
    {
        $listeners = $this->eventDispatcher->getListeners($event);

        foreach ($listeners as $listener) {
            call_user_func($listener, $options);
        }
    }
26103
public function queueEvent($event)
    {
        $this->queue->enqueue($event);

        $class = get_class($event);
        foreach ($this->synchronousEventMap->getListenersForEvent($class) as $listener)
        {
            $this->invokeListener($listener, $event);
        }
    }
972788
private static function _dispatch($command)
	{
		$dispatcher = self::_getDispatcher();
		$commandEvent = new CommandEvent(PluginEvents::COMMAND, $command, self::_getIO(), self::_getIO());
		$dispatcher->dispatch($commandEvent->getName(), $commandEvent);
	}
761521
protected function dispatchEvent($event)
    {
        if (!$this->container) {
            throw new \RuntimeException("The container has not been set up.");
        }
        $dir = $this->container->getParameter('base_dir');
        if (!is_dir($dir) || !is_readable($dir)) {
            throw new \RuntimeException("'${dir}' is not a valid readable directory.");
        }
        $dispatcher = $this->container->get('event_dispatcher');
        $dispatcher->dispatch($event);
    }
713015
public function dispatchEvent($event, $parameters = array()) {
        if (is_string($event)) {
            $event = new BaseEvent($event, $parameters);
        }
        $eventName = $event->getName();
        $event->setDispatcher($this);
        if ($this->hasListeners($eventName)) {
            foreach($this->_listeners[$eventName] as $priority=>$listeners) {
                foreach($listeners as $listener) {
                    if ($event->isPropagationStopped($priority)) {
                        break;
                    }
                    call_user_func($listener, $event);
                }
            }
        }
        return $event;
    }