Runs the dispatch loop
9000
protected function dispatchLoop()
    {
        $ini = eZINI::instance();

        // Start the module loop
        while ( $this->siteBasics['module-run-required'] )
        {
            $objectHasMovedError = false;
            $objectHasMovedURI = false;
            $this->actualRequestedURI = $this->uri->uriString();

            // Extract user specified parameters
            $userParameters = $this->uri->userParameters();

            // Generate a URI which also includes the user parameters
            $this->completeRequestedURI = $this->uri->originalURIString();

            // Check for URL translation
            if ( $this->siteBasics['url-translator-allowed'] && eZURLAliasML::urlTranslationEnabledByUri( $this->uri ) )
            {
                $translateResult = eZURLAliasML::translate( $this->uri );

                if ( !is_string( $translateResult ) && $ini->variable( 'URLTranslator', 'WildcardTranslation' ) === 'enabled' )
                {
                    $translateResult = eZURLWildcard::translate( $this->uri );
                }

                // Check if the URL has moved
                if ( is_string( $translateResult ) )
                {
                    $objectHasMovedURI = $translateResult;
                    foreach ( $userParameters as $name => $value )
                    {
                        $objectHasMovedURI .= '/(' . $name . ')/' . $value;
                    }

                    $objectHasMovedError = true;
                }
            }

            if ( $this->uri->isEmpty() )
            {
                $tmp_uri = new eZURI( $ini->variable( "SiteSettings", "IndexPage" ) );
                $moduleCheck = eZModule::accessAllowed( $tmp_uri );
            }
            else
            {
                $moduleCheck = eZModule::accessAllowed( $this->uri );
            }

            if ( !$moduleCheck['result'] )
            {
                if ( $ini->variable( "SiteSettings", "ErrorHandler" ) == "defaultpage" )
                {
                    $defaultPage = $ini->variable( "SiteSettings", "DefaultPage" );
                    $this->uri->setURIString( $defaultPage );
                    $moduleCheck['result'] = true;
                }
            }

            $displayMissingModule = false;
            $this->oldURI = $this->uri;

            if ( $this->uri->isEmpty() )
            {
                if ( !fetchModule( $tmp_uri, $this->check, $this->module, $moduleName, $functionName, $params ) )
                    $displayMissingModule = true;
            }
            else if ( !fetchModule( $this->uri, $this->check, $this->module, $moduleName, $functionName, $params ) )
            {
                if ( $ini->variable( "SiteSettings", "ErrorHandler" ) == "defaultpage" )
                {
                    $tmp_uri = new eZURI( $ini->variable( "SiteSettings", "DefaultPage" ) );
                    if ( !fetchModule( $tmp_uri, $this->check, $this->module, $moduleName, $functionName, $params ) )
                        $displayMissingModule = true;
                }
                else
                    $displayMissingModule = true;
            }

            if ( !$displayMissingModule && $moduleCheck['result'] && $this->module instanceof eZModule )
            {
                // Run the module/function
                eZDebug::addTimingPoint( "Module start '" . $this->module->attribute( 'name' ) . "'" );

                $moduleAccessAllowed = true;
                $omitPolicyCheck = true;
                $runModuleView = true;

                $availableViewsInModule = $this->module->attribute( 'views' );
                if (
                    !isset( $availableViewsInModule[$functionName] )
                    && !$objectHasMovedError
                    && !isset( $this->module->Module['function']['script'] )
                )
                {
                    $moduleResult = $this->module->handleError( eZError::KERNEL_MODULE_VIEW_NOT_FOUND, 'kernel', array( "check" => $moduleCheck ) );
                    $runModuleView = false;
                    $this->siteBasics['policy-check-required'] = false;
                    $omitPolicyCheck = true;
                }

                if ( $this->siteBasics['policy-check-required'] )
                {
                    $omitPolicyCheck = false;
                    $moduleName = $this->module->attribute( 'name' );
                    if ( in_array( $moduleName, $this->siteBasics['policy-check-omit-list'] ) )
                        $omitPolicyCheck = true;
                    else
                    {
                        $policyCheckViewMap = $this->getPolicyCheckViewMap( $this->siteBasics['policy-check-omit-list'] );
                        if ( isset( $policyCheckViewMap[$moduleName][$functionName] ) )
                            $omitPolicyCheck = true;
                    }
                }
                if ( !$omitPolicyCheck )
                {
                    $currentUser = eZUser::currentUser();
                    $siteAccessResult = $currentUser->hasAccessTo( 'user', 'login' );

                    $hasAccessToSite = false;
                    if ( $siteAccessResult[ 'accessWord' ] === 'limited' )
                    {
                        $policyChecked = false;
                        foreach ( array_keys( $siteAccessResult['policies'] ) as $key )
                        {
                            $policy = $siteAccessResult['policies'][$key];
                            if ( isset( $policy['SiteAccess'] ) )
                            {
                                $policyChecked = true;
                                $crc32AccessName = eZSys::ezcrc32( $this->access[ 'name' ] );
                                eZDebugSetting::writeDebug( 'kernel-siteaccess', $policy['SiteAccess'], $crc32AccessName );
                                if ( in_array( $crc32AccessName, $policy['SiteAccess'] ) )
                                {
                                    $hasAccessToSite = true;
                                    break;
                                }
                            }
                            if ( $hasAccessToSite )
                                break;
                        }
                        if ( !$policyChecked )
                            $hasAccessToSite = true;
                    }
                    else if ( $siteAccessResult[ 'accessWord' ] === 'yes' )
                    {
                        eZDebugSetting::writeDebug( 'kernel-siteaccess', "access is yes" );
                        $hasAccessToSite = true;
                    }
                    else if ( $siteAccessResult['accessWord'] === 'no' )
                    {
                        $accessList = $siteAccessResult['accessList'];
                    }

                    if ( $hasAccessToSite )
                    {
                        $accessParams = array();
                        $moduleAccessAllowed = $currentUser->hasAccessToView( $this->module, $functionName, $accessParams );
                        if ( isset( $accessParams['accessList'] ) )
                        {
                            $accessList = $accessParams['accessList'];
                        }
                    }
                    else
                    {
                        eZDebugSetting::writeDebug( 'kernel-siteaccess', $this->access, 'not able to get access to siteaccess' );
                        $moduleAccessAllowed = false;
                        if ( $ini->variable( "SiteAccessSettings", "RequireUserLogin" ) == "true" )
                        {
                            $this->module = eZModule::exists( 'user' );
                            if ( $this->module instanceof eZModule )
                            {
                                $moduleResult = $this->module->run(
                                    'login',
                                    array(),
                                    array(
                                        'SiteAccessAllowed' => false,
                                        'SiteAccessName' => $this->access['name']
                                    )
                                );
                                $runModuleView = false;
                            }
                        }
                    }
                }

                $GLOBALS['eZRequestedModule'] = $this->module;

                if ( $runModuleView )
                {
                    if ( $objectHasMovedError == true )
                    {
                        $moduleResult = $this->module->handleError( eZError::KERNEL_MOVED, 'kernel', array( 'new_location' => $objectHasMovedURI ) );
                    }
                    else if ( !$moduleAccessAllowed )
                    {
                        if ( isset( $availableViewsInModule[$functionName][ 'default_navigation_part' ] ) )
                        {
                            $defaultNavigationPart = $availableViewsInModule[$functionName][ 'default_navigation_part' ];
                        }

                        if ( isset( $accessList ) )
                            $moduleResult = $this->module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel', array( 'AccessList' => $accessList ) );
                        else
                            $moduleResult = $this->module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );

                        if ( isset( $defaultNavigationPart ) )
                        {
                            $moduleResult['navigation_part'] = $defaultNavigationPart;
                            unset( $defaultNavigationPart );
                        }
                    }
                    else
                    {
                        if ( !isset( $userParameters ) )
                        {
                            $userParameters = false;
                        }

                        // Check if we should switch access mode (http/https) for this module view.
                        eZSSLZone::checkModuleView( $this->module->attribute( 'name' ), $functionName );

                        $moduleResult = $this->module->run( $functionName, $params, false, $userParameters );

                        if ( $this->module->exitStatus() == eZModule::STATUS_FAILED && $moduleResult == null )
                            $moduleResult = $this->module->handleError(
                                eZError::KERNEL_MODULE_VIEW_NOT_FOUND,
                                'kernel',
                                array(
                                    'module' => $moduleName,
                                    'view' => $functionName
                                )
                            );
                    }
                }
            }
            else if ( $moduleCheck['result'] )
            {
                eZDebug::writeError( "Undefined module: $moduleName", "index" );
                $this->module = new eZModule( "", "", $moduleName );
                $GLOBALS['eZRequestedModule'] = $this->module;
                $moduleResult = $this->module->handleError( eZError::KERNEL_MODULE_NOT_FOUND, 'kernel', array( 'module' => $moduleName ) );
            }
            else
            {
                if ( $moduleCheck['view_checked'] )
                    eZDebug::writeError( "View '" . $moduleCheck['view'] . "' in module '" . $moduleCheck['module'] . "' is disabled", "index" );
                else
                    eZDebug::writeError( "Module '" . $moduleCheck['module'] . "' is disabled", "index" );
                $GLOBALS['eZRequestedModule'] = $this->module = new eZModule( "", "", $moduleCheck['module'] );
                $moduleResult = $this->module->handleError( eZError::KERNEL_MODULE_DISABLED, 'kernel', array( 'check' => $moduleCheck ) );
            }
            $this->siteBasics['module-run-required'] = false;
            if ( $this->module->exitStatus() == eZModule::STATUS_RERUN )
            {
                if ( isset( $moduleResult['rerun_uri'] ) )
                {
                    $this->uri = eZURI::instance( $moduleResult['rerun_uri'] );
                    $this->siteBasics['module-run-required'] = true;
                }
                else
                    eZDebug::writeError( 'No rerun URI specified, cannot continue', 'index.php' );
            }

            if ( is_array( $moduleResult ) )
            {
                if ( isset( $moduleResult["pagelayout"] ) )
                {
                    $this->siteBasics['show-page-layout'] = $moduleResult["pagelayout"];
                    $GLOBALS['eZCustomPageLayout'] = $moduleResult["pagelayout"];
                }
                if ( isset( $moduleResult["external_css"] ) )
                    $this->siteBasics['external-css'] = $moduleResult["external_css"];
            }
        }

        return $moduleResult;
    }
11828
def _run(self):
        ''''''
      
        while self._is_running:
            yield from self._task()

        # Signal that the loop has finished.
        self._run_complete.set_result(True)
806113
function run() {
    generator.load(function(err) {
      if (err) return log(err);

      if (opts.outputOnly) {
        generator.outputPages(function(err, result) {
          if (err) { log(err); }
          log('output %s generated pages', u.flatten(result).length);
        });

        var statics = require('./server/serve-statics')(opts, function(){
          statics.outputAll();
        });
        require('./server/serve-scripts')(opts).outputAll(generator);
        generator.unload();
        return;
      }

      if (opts.logPages) {
        generator.logPages();
        generator.unload();
        return;
      }

      require('./server/watch-sources')(generator);
      generator.listen(true);

      if (!opts['no-server']) { expressApp(); }
    });
  }
1239659
def run(self, loop=None):
        
        if loop is None:
            loop = asyncio.get_event_loop()

        self.loop = loop

        loop.run_until_complete(self.startup())

        for func in self.tasks:
            self.start_task(func)

        try:
            task = self.start_task(self.main_task)
            loop.run_until_complete(task)
        except (KeyboardInterrupt, SystemError):
            print("Attempting graceful shutdown, press Ctrl-C again to exit", flush=True)

            def shutdown_exception_handler(_loop, context):
                if "exception" not in context or not isinstance(context["exception"], asyncio.CancelledError):
                    _loop.default_exception_handler(context)
            loop.set_exception_handler(shutdown_exception_handler)

            tasks = asyncio.gather(*self._started_tasks, loop=loop, return_exceptions=True)
            tasks.add_done_callback(lambda _: loop.stop())
            tasks.cancel()

            while not tasks.done() and not loop.is_closed():
                loop.run_forever()
        finally:
            loop.run_until_complete(self.shutdown())
            loop.run_until_complete(self.cleanup())
            loop.close()
1204443
def _run(self):
        ''''''
        stop = self._stop_evt
        connected = self._connected_evt
        tws = self._tws

        fd = tws.fd()
        pollfd = [fd]

        while not stop.is_set():
            while (not connected.is_set() or not tws.isConnected()) and not stop.is_set():
                connected.clear()
                backoff = 0
                retries = 0

                while not connected.is_set() and not stop.is_set():
                    if tws.reconnect_auto and not tws.reconnect():
                        if backoff < self.MAX_BACKOFF:
                            retries += 1
                            backoff = min(2**(retries + 1), self.MAX_BACKOFF)
                        connected.wait(backoff / 1000.)
                    else:
                        connected.wait(1)
                fd = tws.fd()
                pollfd = [fd]

            if fd > 0:
                try:
                    evtin, _evtout, evterr = select.select(pollfd, [], pollfd, 1)
                except select.error:
                    connected.clear()
                    continue
                else:
                    if fd in evtin:
                        try:
                            if not tws.checkMessages():
                                tws.eDisconnect(stop_polling=False)
                                continue
                        except (SystemExit, SystemError, KeyboardInterrupt):
                            break
                        except:
                            try:
                                self._wrapper.pyError(*sys.exc_info())
                            except:
                                print_exc()
                    elif fd in evterr:
                        connected.clear()
                        continue
297500
public void run ()
    {
        // wait till everything in the dobjmgr queue and invokers are processed and then start the
        // connection manager
        ((PresentsInvoker)_invoker).postRunnableWhenEmpty(new Runnable() {
            public void run () {
                // Take as long as you like opening to the public
                _omgr.postRunnable(new LongRunnable() {
                    public void run () {
                        openToThePublic();
                    }
                });
            }
        });
        // invoke the dobjmgr event loop
        _omgr.run();
    }
1244833
def run():
    
    options = btoptions.Options()
    btlog.initialize_logging(options.log_level, options.log_file)
    app = btapp.get_application()
    app.run()
1270367
public void run() {
		
		while( running ) {
			
			long interval_end = System.currentTimeMillis() + interval;
			
			while( interval_end > System.currentTimeMillis() ) {
				
				Thread.yield();
				
			}
			
			fireIntervalElapsed();
			
		}
		
		running = false;
		
	}
609450
def run(self):
        ''''''
        for line in iter(self._fd.readline, ''):
            self._queue.put(line)
1373186
def run(self):
        
        while True:
            path, params = self.path_queue.get()
            errors = run(path, **params)
            self.result_queue.put(errors)
            self.path_queue.task_done()
310730
def run(self, *args, **kwargs):
    """"""

    for job in self.jobs:
      job.run(*args, **kwargs)
767196
def run(self):
        
        self._connection = self.connect()
        self._connection.ioloop.start()
21671
public function run() {
        try {
            $request  = $this->getLoops()->getService("request");
            $response = $this->getLoops()->getService("response");
            $web_core = $this->getLoops()->getService("web_core");

            //dispatch request
            echo $web_core->dispatch($this->url, $request, $response);
        }
        catch(Throwable $exception) {
            http_response_code(500);

            try {
                $renderer = $this->getLoops()->getService("renderer");
                echo $renderer->render($exception);
            }
            catch(Throwable $render_exception) {
                Misc::displayException($exception);
            }
        }
    }
484230
def run(self):
        
        while True:
            msg = self._queue.get()
            if msg is _SHUTDOWN:
                break
            event, args, kwargs = msg
            self._logger('<< %s', event)
            for func in self._callbacks.get(event, []):
                func(*args, **kwargs)
471221
def run(self):
        """"""
        resp = _wait_until(obj=self.obj, att=self.att,
                desired=self.desired, callback=None,
                interval=self.interval, attempts=self.attempts,
                verbose=False, verbose_atts=None)
        self.callback(resp)
1292208
def dispatch(self, command: Command) -> Iterator[Any]:
        
        LOG.debug("Dispatching command %s", command["command"])
        for callback in self._routes[command["command"]]:
            yield callback
880451
def run(self):
        """"""
        while True:
            try:
                self.perform_iteration()
            except Exception:
                traceback.print_exc()
                pass

            time.sleep(ray_constants.REPORTER_UPDATE_INTERVAL_MS / 1000)