Execute an event

@param   string  $eventName Name of event
@param   mixed   $object Object on wich object will be executed
@return  void
165863
public function execute($eventName, $object)
    {
        if (isset($this->events[$eventName]) && is_array(($this->events[$eventName]))) {
            foreach ($this->events[$eventName] as $method) {
                call_user_func([$object, $method]);
            }
        }
    }
945856
public function trigger($eventName, $origin = null, $context = [], EventInterface $event = null)
    {
        if ($eventsHandler = $this->getEventsHandler()) {
            $eventsHandler->trigger($eventName, $origin, $context, $event);
        }
    }
1126005
protected function assertHasStepForEvent($eventName)
    {
        if (!isset($this->eventBindings[$eventName])) {
            throw new NoStepForEventFoundException(
                sprintf('No step handling event %s in scenario %s.', $eventName, get_class($this->scenario))
            );
        }
    }
382013
public function run($eventname, $count)
    {
        $queueEvents = $this->loadQueue($eventname, $count);

        if ($queueEvents->numRows) {
            while ($queueEvents->next()) {
                if ($this->checkInterval($queueEvents)) {
                    $this->setStartTime($queueEvents->id);
                    $jobEvent = $this->dispatch($queueEvents);
                    $this->setEndTime($queueEvents->id, $queueEvents->intervaltorun);
                    $this->saveJobResult($queueEvents->id, $jobEvent);
                }
            }
        } else {
            $this->response($eventname, 'noActiveJobs', 'INFO');
        }
    }
21450
private function executeListeners($eventName) {
        $listeners = $this->eventConfig[$eventName];
        foreach ($listeners as $listener) {
            $return = $this->classInvoker->invoke($listener);

            //如果某个事件监听器返回“false”，则停止事件的传播
            if ($return === false) {
                break;
            }
        }
    }
1071750
protected function beforeDispatch(string $eventName, $event)
    {
        $this->preDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
    }
739019
public function handle($eventName, $data = null)
    {
        $results = [];

        if ($actions = $this->getEventActions($eventName)) {

            $actions = is_array($actions) ? $actions : [$actions];
            $data = is_array($data) ? $data : [$data];

            foreach ($actions as $action) {
                if ($result = $this->call($eventName, $action, $data)) {
                    $results[$action] = $result;
                }
            }
        }

        return count($results) === 1 ? reset($results) : $results;
    }
1344759
protected function createEvent($eventName)
    {
        if (null === $this->defaultEvent) {
            return new Event($eventName);
        }
        $event = clone $this->defaultEvent;
        $event->setName($eventName);
        return $event;
    }
804075
protected function handle(Event $event)
    {
        $method = $this->getApplyMethod($event);
        if (!method_exists($this, $method)) {
            return;
        }
        $this->$method($event);
    }
955190
protected function execute($event)
    {
        foreach($this->events[$event] as $handler) {
            $this->listen($event, $handler);
        }
    }
356252
protected function event($name, $type, $object, $event)
    {
        if (is_null($this->triggers)) {
            return;
        }

        $event = ucfirst($event);

        $deprecatedEvent = strtolower($event); // @deprecated Backwards compatibility

        if (method_exists($this->triggers, "{$name}{$event}")) {
            call_user_func(array($this->triggers, "{$name}{$event}"), $object);
        } elseif (method_exists($this->triggers, "{$name}_{$deprecatedEvent}")) { // @deprecated Backwards compatibility
            call_user_func(array($this->triggers, "{$name}_{$deprecatedEvent}"), $object);
        }

        if ($type) {

            $type = ucfirst($type);

            if (method_exists($this->triggers, "{$name}{$type}{$event}")) {
                call_user_func(array($this->triggers, "{$name}{$type}{$event}"), $object);
            } elseif (method_exists($this->triggers, "{$name}_{$type}_{$deprecatedEvent}")) { // @deprecated Backwards compatibility
                call_user_func(array($this->triggers, "{$name}_{$type}_{$deprecatedEvent}"), $object);
            }
        }
    }
228708
protected function bindPatterns($eventName)
    {
        if (isset($this->syncedEvents[$eventName])) {
            return;
        }

        foreach ($this->patterns as $eventPattern => $patterns) {
            foreach ($patterns as $pattern) {
                if ($pattern->test($eventName)) {
                    $pattern->bind($this->dispatcher, $eventName);
                }
            }
        }

        $this->syncedEvents[$eventName] = true;
    }
614892
public function trigger($eventName, $target = null)
    {
        $event = $this->createEvent($eventName);
        $event->setTarget($target);
        $this->triggerHandlers($event);
    }
412960
protected function emitWithCancellingPropagationCheck(string $eventName, array $arguments = []): void
    {
        foreach ($this->getEventSubscribers($eventName) as $subscriber) {
            if (call_user_func_array($subscriber, $arguments) === false) {
                break;
            }
        }
    }
576094
function(event_name, event_object) {

		if (this._focused_element != event_object.target) {
			this._setTarget(null);
			this._focused_element = event_object.target;
		}

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

        return parent::dispatch($eventName, $event);
    }
609789
protected function dispatch(string $eventName, DomainEvent $event): void
    {
        $listeners = $this->dispatcher->getListeners($eventName);

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