Builds the event dispatching configuration.
421988
private function buildEventMap()
    {
        $this->synchronousEventMap  = new EventMapping();
        $this->asynchronousEventMap = new EventMapping();

        $eventMap       = NULL;
        $annotationName = 'Helmich\\EventBroker\\Annotations\\Listener';

        $classes = $this->reflectionService->getClassesContainingMethodsAnnotatedWith($annotationName);
        foreach ($classes as $class)
        {
            $classReflection = new ClassReflection($class);
            /** @var MethodReflection $method */
            foreach ($classReflection->getMethods() as $method)
            {
                if ($this->reflectionService->isMethodAnnotatedWith($class, $method->getName(), $annotationName))
                {
                    /** @var Listener $annotation */
                    $annotation = $this->reflectionService->getMethodAnnotation(
                        $class,
                        $method->getName(),
                        $annotationName
                    );

                    $event = $annotation->event;
                    $this
                        ->getEventMap($annotation->synchronous)
                        ->addListenerForEvent($event, [$class, $method->getName()]);
                }
            }
        }
    }
1172036
<L, E extends Input.Impl> void dispatch(
      Class<L> listenerType, E event, Interaction<L, E> interaction, Interaction<L, E> onCancel) {
    dispatch(event.captureState.layer, listenerType, event, interaction, onCancel);
  }
1335756
public function build(): DispatchKeyEventRequest
	{
		$instance = new DispatchKeyEventRequest();
		if ($this->type === null) {
			throw new BuilderException('Property [type] is required.');
		}
		$instance->type = $this->type;
		$instance->modifiers = $this->modifiers;
		$instance->timestamp = $this->timestamp;
		$instance->text = $this->text;
		$instance->unmodifiedText = $this->unmodifiedText;
		$instance->keyIdentifier = $this->keyIdentifier;
		$instance->code = $this->code;
		$instance->key = $this->key;
		$instance->windowsVirtualKeyCode = $this->windowsVirtualKeyCode;
		$instance->nativeVirtualKeyCode = $this->nativeVirtualKeyCode;
		$instance->autoRepeat = $this->autoRepeat;
		$instance->isKeypad = $this->isKeypad;
		$instance->isSystemKey = $this->isSystemKey;
		$instance->location = $this->location;
		return $instance;
	}
1264873
@SuppressWarnings("PMD.UseVarargs")
    /* default */ void dispatch(EventPipeline pipeline,
            EventBase<?> event, Channel[] channels) {
        HandlerList handlers = getEventHandlers(event, channels);
        handlers.process(pipeline, event);
    }
494389
def dispatch_event(self, event):
        
        if self.config["debug"]:
            self.py3_wrapper.log("received event {}".format(event))

        # usage variables
        event["index"] = event.get("index", "")
        instance = event.get("instance", "")
        name = event.get("name", "")

        # composites have an index which is passed to i3bar with
        # the instance.  We need to separate this out here and
        # clean up the event.  If index
        # is an integer type then cast it as such.
        if " " in instance:
            instance, index = instance.split(" ", 1)
            try:
                index = int(index)
            except ValueError:
                pass
            event["index"] = index
            event["instance"] = instance

        if self.config["debug"]:
            self.py3_wrapper.log(
                'trying to dispatch event to module "{}"'.format(
                    "{} {}".format(name, instance).strip()
                )
            )

        # guess the module config name
        module_name = "{} {}".format(name, instance).strip()

        default_event = False
        module_info = self.output_modules.get(module_name)
        module = module_info["module"]
        # execute any configured i3-msg command
        # we do not do this for containers
        # modules that have failed do not execute their config on_click
        if module.allow_config_clicks:
            button = event.get("button", 0)
            on_click = self.on_click.get(module_name, {}).get(str(button))
            if on_click:
                task = EventClickTask(module_name, event, self, on_click)
                self.py3_wrapper.timeout_queue_add(task)
            # otherwise setup default action on button 2 press
            elif button == 2:
                default_event = True

        # do the work
        task = EventTask(module_name, event, default_event, self)
        self.py3_wrapper.timeout_queue_add(task)
174986
@Override
    public synchronized void dispatch(@NonNull Event event) {
        String type = event.type;
        List<EventHandlerWrapper> eventHandlers = subscribers.get(type);
        if (eventHandlers != null) {
            EventHandlerWrapper handler = null;
            for (int i = 0, size = eventHandlers.size(); i < size; i++) {
                handler = eventHandlers.get(i);
                if (handler.eventHandlerReceiver != null) {
                    handler.handleEvent(event);
                } else {
                    if (!TextUtils.isEmpty(handler.producer) && handler.producer.equals(event.sourceId)
                            || TextUtils.isEmpty(handler.producer)) {
                        handler.handleEvent(event);
                    }
                }
            }
        }
    }
1321814
public function dispatchCallbackEvents()
    {
        foreach ($this->getAllCallbackEvents() as $event) {
            $this->dispatcher->dispatch($event->getName(), $event);

            if ($event instanceof PostbackEvent) {
                // Dispatch postback payload
                $this->dispatcher->dispatch($event->getPostback()->getPayload(), $event);
            }

            if ($event instanceof MessageEvent && $event->isQuickReply()) {
                // Dispatch quick reply payload
                $this->dispatcher->dispatch($event->getQuickReplyPayload(), $event);
            }
        }
    }
192914
public function loadConfiguration(): void
	{
		$builder = $this->getContainerBuilder();
		$config = $this->validateConfig($this->defaults);

		if ($config['lazy'] === true) {
			$builder->addDefinition($this->prefix('dispatcher'))
				->setType(LazyEventDispatcher::class);
		} else {
			$builder->addDefinition($this->prefix('dispatcher'))
				->setType(EventDispatcher::class);
		}
	}
745793
protected function configChanged() {
    if (self::$logger->isDebugEnabled()) {
      self::$logger->debug("Configuration is changed");
    }
    if (ObjectFactory::isConfigured()) {
      if (self::$logger->isDebugEnabled()) {
        self::$logger->debug("Emitting change event");
      }
      ObjectFactory::getInstance('eventManager')->dispatch(ConfigChangeEvent::NAME,
              new ConfigChangeEvent());
    }
  }
345833
function(){
    if (!this.triggers) { return; }

    var triggerEvents = {};

    // Allow `triggers` to be configured as a function
    var triggers = _.result(this, "triggers");

    // Configure the triggers, prevent default
    // action and stop propagation of DOM events
    _.each(triggers, function(value, key){

      // build the event handler function for the DOM event
      triggerEvents[key] = function(e){

        // stop the event in its tracks
        if (e && e.preventDefault){ e.preventDefault(); }
        if (e && e.stopPropagation){ e.stopPropagation(); }

        // build the args for the event
        var args = {
          view: this,
          model: this.model,
          collection: this.collection
        };

        // trigger the event
        this.triggerMethod(value, args);
      };

    }, this);

    return triggerEvents;
  }
927958
public ServerSentEvent build() {
        if (id == null && event == null &&
            retry == null && comment == null && data == null) {
            return DefaultServerSentEvent.EMPTY;
        }
        return new DefaultServerSentEvent(id, event, retry, comment, data);
    }
412202
def _dispatch_event(self, event: LutronEvent, params: Dict):
    """"""
    for handler, context in self._subscribers:
      handler(self, context, event, params)
1106267
function forEachEventDispatch(event, cb) {
  var dispatchListeners = event._dispatchListeners;
  var dispatchIDs = event._dispatchIDs;
  if ("production" !== "development") {
    validateEventDispatches(event);
  }
  if (Array.isArray(dispatchListeners)) {
    for (var i = 0; i < dispatchListeners.length; i++) {
      if (event.isPropagationStopped()) {
        break;
      }
      // Listeners and IDs are two parallel arrays that are always in sync.
      cb(event, dispatchListeners[i], dispatchIDs[i]);
    }
  } else if (dispatchListeners) {
    cb(event, dispatchListeners, dispatchIDs);
  }
}
329892
public static function initEvent()
    {
        if (!self::$supported) {
            return;
        }
        self::updateConfig();
        self::$fd = eio_get_event_stream();
        self::$ev = EventLoop::$instance->event(self::$fd,
            \Event::READ | \Event::PERSIST,
            function ($fd, $events, $arg) {
                while (eio_nreqs()) {
                    eio_poll();
                }
            }
        );
        self::$ev->add();
    }
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)
1319746
public function updateConfiguration()
    {
        $this->getEventDispatcher()->dispatch(
            UpdateConfigurationEvent::NAME,
            new UpdateConfigurationEvent($this->getWebserviceId(), $this->getConfiguration())
        );
    }
919097
public static function buildConfig(Event $event)
    {
        if (true === $event->isDevMode()) {
            $app = new AppKernel('dev', true);
            $app->boot();
            $container = $app->getContainer();
            /**
             * @var ConfigurationProcessorHandler
             */
            $processor = $container->get('bruli.command.bus');

            $processor->handle(new ConfigurationProcessor($event->getIO()));
        }
    }