@see EventDispatcherInterface::dispatch

@api
544095
public function dispatch($eventName, sfEvent $event = null)
    {
        if (null !== $this->application) {
            $this->application->debug(sprintf('Dispatching `%s` event.', $eventName));
        }

        return parent::dispatch($eventName, $event);
    }
70293
public function dispatch() {
		$handler = current($this->handlers);
		if (!$handler) {
			return;
		}

		$this->resolveHandler($handler);

		return $this;
	}
703198
public function dispatch()
    {
        if ($this->session->isStarted() === false) {
            $this->session->start();
        }

        return $this->renderBuffer(function () {
            return $this->bar->dispatchAssets();
        });
    }
199877
public function my_dispatchEvent($type, $data)
    {
        foreach ($this->client as $client) {
            $client->dispatchEvent($type, $data);
        }
    }
577153
public static function getEventDispatcher(): EventDispatcherInterface
    {
        if (isset(self::$dispatchers[static::class])) {
            return self::$dispatchers[static::class];
        }

        return self::$dispatchers[static::class] = new EventDispatcher();
    }
172150
public function dispatchEvent($eventName, Event $event = null)
    {
        if ($this->eventDispatcher instanceof EventDispatcherInterface) {
            $this->eventDispatcher->dispatch($eventName, $event);
        }
    }
162182
public function dispatchEvent($name, $event = array())
    {
        $result = array();
        
        //Make sure we have an event object
        if (! $event instanceof AnEvent) {
            $event = new AnEvent($event);
        }
        
        $event->setName($name)->setDispatcher($this);
             
        //Nofity the listeners
        if (isset($this->_listeners[$name])) {
            foreach ($this->_listeners[$name] as $listener) {
                $listener->$name($event);
                
                if (! $event->canPropagate()) {
                    break;
                }
            }
        }
        
        return $this;
    }
829442
public static function dispatch()
    {

        $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
        $method = $_SERVER['REQUEST_METHOD'];

        $searches = array_keys(static::$patterns);
        $replaces = array_values(static::$patterns);

        self::$routes = str_replace('//', '/', self::$routes);

        $foundRoute = false;

        // Parse query parameters
        {
            $query = '';
            $q_arr = array();
            if (strpos($uri, '&') > 0) {
                $query = substr($uri, strpos($uri, '&') + 1);
                $uri = substr($uri, 0, strpos($uri, '&'));
                $q_arr = explode('&', $query);
                foreach ($q_arr as $q) {
                    $qobj = explode('=', $q);
                    $q_arr[] = array($qobj[0] => $qobj[1]);
                    if (!isset($_GET[$qobj[0]])) {
                        $_GET[$qobj[0]] = $qobj[1];
                    }
                }
            }
        }

        // Check if route is defined without regex

        if (in_array($uri, self::$routes)) {

            $routePos = array_keys(self::$routes, $uri);

            // Foreach route position
            foreach ($routePos as $route) {

                if (self::$methods[$route] == $method || self::$methods[$route] == 'ANY') {
                    $foundRoute = true;

                    // If route is not an object

                    if (!is_object(self::$callbacks[$route])) {

                        // Call object controller and method

                        self::invokeObject(self::$callbacks[$route]);
                        if (self::$halts) return;

                    } else {

                        // Call closure

                        call_user_func(self::$callbacks[$route]);
                        if (self::$halts) return;

                    }
                }

            }

        } else {

            // Check if defined with regex
            $pos = 0;

            // Foreach routes

            foreach (self::$routes as $route) {

                $route = str_replace('//', '/', $route);

                if (strpos($route, ':') !== false) {
                    $route = str_replace($searches, $replaces, $route);
                }

                if (preg_match('#^' . $route . '$#', $uri, $matched)) {

                    if (self::$methods[$pos] == $method || self::$methods[$pos] == 'ANY') {
                        $foundRoute = true;

                        // Remove $matched[0] as [1] is the first parameter.

                        array_shift($matched);

                        if (!is_object(self::$callbacks[$pos])) {

                            // Call object controller and method

                            self::invokeObject(self::$callbacks[$pos], $matched);
                            if (self::$halts) return;

                        } else {

                            // Call closure
                            call_user_func_array(self::$callbacks[$pos], $matched);
                            if (self::$halts) return;

                        }
                    }
                }

                $pos++;
            }
        }

        // Run the error callback if the route was not found

        if (!$foundRoute) {

            if (!self::$errorCallback) {

                self::$errorCallback = function () {
                    header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
                    echo '404';
                };
            }

            if (!is_object(self::$errorCallback)) {

                // Call object controller and method
                self::invokeObject(self::$errorCallback, null, 'No routes found.');
                if (self::$halts) return;

            } else {

                call_user_func(self::$errorCallback);
                if (self::$halts) return;

            }
        }
    }
921630
public function dispatch()
	{
		if(!self::$isDispatched){
		    if (PHP_SAPI == 'cli') {
		        $this->dispatchCli();
		    } else {
                $this->dispatchHttp();
		    }
            self::$isDispatched = true;
        }
    }
677399
function dispatchEvent (event, data) {
    if (hasDOM()) {
      eventEmitter.dispatchEvent(new CustomEvent(event, data));
    } else if (hasEventEmitter()) {
      eventEmitter.emit(event, data);
    }
  }
210089
protected function dispatchConfigurationEvents(): self
    {
        foreach ($this->iterationsEvents as $event) {
            if (!($this->loopCount % $event['count'])) {
                $this->dispatchEvent($event['name']);
            }
        }

        return $this;
    }
1313724
public function doDispatch(DispatchEvent $event)
    {
        $controller = $event->getContext();
        $action     = $event->getParam('action') . 'Action';

        $server   = $this->getServer();
        $request  = $server->getRequest()->withAddedAttributes($event->getParams());
        $response = $server->getResponse();

        $result = call_user_func_array([$controller, $action], [$request, $response]);
        $event->setResult($result);
    }
891400
public function dispatch()
    {
        if (php_sapi_name() === 'cli' || defined('STDIN')) {

            global $argv;

            App::make('Cli', [array_slice($argv, 1), $this]);

            $this->terminate();
        }

        $this->execute()->respond()->terminate();
    }
1114567
public function dispatch($name, Event $e = null)
    {
        return $this->dispatcher->dispatch($name, $e);
    }
284470
public static function dispatch()
    {
        if (self::$force) {
            return null;
        }

        self::forceRender();

        if (self::$views) {
            foreach (self::$views as &$value) {
                $value && self::render($value[0], $value[1]);
            }
        }
    }
665157
public function dispatch(...$params)
    {
        // Verify if the method is 'allowed' in our own context.
        $allowedMethods = $this->getAllowedMethods();
        if ($allowedMethods !== null && ! in_array($this->request->getMethod(), $allowedMethods)) {
            // Not allowed. Return to sender.
        }

        $apiMethod = $this->route->getValue('api_method', 'list');
        return call_user_func_array(array($this, $apiMethod), $params);
    }
1226032
function _dispatch(events, data) {
    var i,
        j,
        i_end,
        j_end,
        event,
        eventName,
        eArray = Array.isArray(events) ?
                   events :
                   events.split(/ /);

    data = data === undefined ? {} : data;

    for (i = 0, i_end = eArray.length; i !== i_end; i += 1) {
      eventName = eArray[i];

      if (_handlers[eventName]) {
        event = {
          type: eventName,
          data: data || {}
        };

        for (j = 0, j_end = _handlers[eventName].length; j !== j_end; j += 1)
          try {
            _handlers[eventName][j].handler(event);
          } catch (e) {}
      }
    }
  }