returns a Dispatcher instance.

@return dispatcher instance
433818
public Dispatcher getInstance() {
        try {
            return (Dispatcher) Class.forName(dispatcherImpl)
                    .getConstructor(Configuration.class).newInstance(conf);
        } catch (InstantiationException e) {
            throw new AssertionError(e);
        } catch (IllegalAccessException e) {
            throw new AssertionError(e);
        } catch (ClassNotFoundException e) {
            throw new AssertionError(e);
        } catch (ClassCastException e) {
            throw new AssertionError(e);
        } catch (NoSuchMethodException e) {
            throw new AssertionError(e);
        } catch (InvocationTargetException e) {
            throw new AssertionError(e);
        }
    }
185324
protected function getLoader(): Loader
    {
        $event = LoaderEvent::create(new Loader());
        $this->getEventManager()->dispatch($event);

        return $event->getResultLoader();
    }
808713
protected function registerDispatcher()
    {
        $this->app->singleton(Dispatcher::class, function() {
            return new Dispatcher(
                $this->app->make('files'), $this->app->make('html'), $this->app->make('antares.asset.resolver'), $this->app->make('path.public')
            );
        });

        $this->app->alias(Dispatcher::class, 'antares.asset.dispatcher');
    }
467157
public function controllerDispatcher()
    {
        if ($this->container->bound(ControllerDispatcherContract::class)) {
            return $this->container->make(ControllerDispatcherContract::class);
        }

        return new ControllerDispatcher($this->container);
    }
1324309
public function scheduler()
    {
        if (is_null($this->scheduler)) {
            $this->scheduler = app(Scheduler::class);
        }

        return $this->scheduler;
    }
793700
public function getDispatcher(): DispatcherInterface
    {
        if (is_null($this->dispatcher)) {
            $this->setDispatcher($this->resolve(HttpDispatcher::class));
        }

        return $this->dispatcher;
    }
1023120
public function getProxyGenerator()
    {
        if (!$this->proxyGenerator) {
            $this->proxyGenerator = new ServiceProxyGenerator($this->getProxyDir(), $this->getProxyNs());
        }
        
        return $this->proxyGenerator;
    }
125535
public function dispatch($dispatch = null)
    {
        if (!is_null($dispatch)) {
            $this->dispatch = $dispatch;
        }
        return $this->dispatch;
    }
344489
public static function getInstance()
    {
        if (null === self::$instance) {
            $class          = new \ReflectionClass(__CLASS__);
            self::$instance = $class->newInstanceArgs(func_get_args());
        }

        return self::$instance;
    }
1189400
function Dispatcher() {
  let lastId = 1;
  let prefix = "ID_";
  let callbacks = {};
  let isPending = {};
  let isHandled = {};
  let isDispatching = false;
  let pendingPayload = null;

  function invokeCallback(id) {
    isPending[id] = true;
    callbacks[id](pendingPayload);
    isHandled[id] = true;
  }

  this.register = callback => {
    let id = prefix + lastId++;
    callbacks[id] = callback;
    return id;
  };

  this.unregister = id => {
    if (!callbacks.hasOwnProperty(id))
      return new Error("Cannot unregister unknown ID!");
    delete callbacks[id];
    return id;
  };

  this.waitFor = ids => {
    for (var i = 0; i < ids.length; i++) {
      var id = ids[id];
      if (isPending[id]) {
        return new Error("Circular dependency waiting for " + id);
      }

      if (!callbacks[id]) {
        return new Error(`waitFor: ${id} is not a registered callback.`);
      }

      invokeCallback(id);
    }

    return undefined;
  };

  this.dispatch = payload => {
    if (isDispatching) return new Error("Cannot dispatch while dispatching.");

    // start
    for (var id in callbacks) {
      isPending[id] = false;
      isHandled[id] = false;
    }

    pendingPayload = payload;
    isDispatching = true;

    // run each callback.
    try {
      for (var id in callbacks) {
        if (isPending[id]) continue;
        invokeCallback(id);
      }
    } finally {
      pendingPayload = null;
      isDispatching = false;
    }

    return payload;
  };
}
600633
public function getMessageHandler()
    {
        if (null !== $this->messageHandler) {
            return $this->messageHandler;
        }

        return $this->messageHandler = new MessageHandler($this);
    }
294884
protected function getDispatcher()
    {
        if ($this->dispatcher === null) {
            $collector = new RouteCollector(
                new Parser,
                new Generator
            );

            foreach ($this->routes as $route) {
                $collector->addRoute($route[0], $route[1], $route[2]);
            }

            $this->dispatcher = new Dispatcher($collector->getData());
            $this->routes = [];

            unset($collector);
        }

        return $this->dispatcher;
    }
762214
public function dispatch()
    {

        $name = $this->generateClassName($this->namespace, $this->class);

        // the controller instance
        $controller = App::make($name);


        if ($controller instanceof Controller) {
            // register the parameters
            $controller->runControllerWithParameters(ParameterBag::getParameters());


            // return the instance
            return $controller;
        } else {
            throw new ControllerException(sprintf('%s is not a instance of  controller', $name));
        }
    }
23184
public static function getInstance()
    {
        return new GeneratorFinderCache(
            new GeneratorFinder(
                TranstyperFactory::getInstance(),
                GeneratorValidatorFactory::getInstance(),
                new FileManager()
            ),
            Installer::getDirectories(),
            new FileManager()
        );
    }
747084
function (dispatcher) {

    if (dispatchers.isDispatcher(dispatcher)) {
      this.dispatcher = dispatcher;
    } else {
      this.dispatcher = new dispatchers.Dispatcher();
    }

    var action = this;
    var prototype = Object.getPrototypeOf(this);
    Object.keys(prototype).forEach(function (method) {
      if (method !== 'dispatch') {
        action[method] = function () {
          var ret = prototype[method].apply(action, arguments);
          if (typeof ret !== 'undefined') {
            action.dispatch(ret);
          }
        };
      }
    });
  }
573482
protected function _getDispatcher()
    {
        if (!self::$_dispatcher)
        {
            JPluginHelper::importPlugin('finder');
            self::$_dispatcher = JEventDispatcher::getInstance();
        }

        return self::$_dispatcher;
    }
1102831
protected function dispatcherCurrentNode() {
		$current = $this->builder->stack->current;
		if ( $current && $current->stackIndex === 0 && $this->builder->isFragment ) {
			return $this->builder->fragmentContext;
		} else {
			return $current;
		}
	}