Public: Run the main loop.
177575
def run
      trap(:CHLD) { awake }
      SIGNALS.each { |signal| trap(signal) { SIGNAL_QUEUE << signal ; awake } }
      @socket.close_on_exec = true
      write_procline('starting')

      config = Resqued::Config.new(@config_paths)
      set_default_resque_logger
      config.before_fork(info)
      report_to_master("RUNNING")

      write_procline('running')
      init_workers(config)
      exit_signal = run_workers_run

      write_procline('shutdown')
      burn_down_workers(exit_signal || :QUIT)
    end
902841
def run(self):
        
        self.collector.start()
        if self.standalone:
            self.collector.join()
1008513
public function run()
    {
        if (!$this->osimage instanceof Osimage) {
            echo $this->imageName;

            return;
        }

        echo $this->osimage->getFullOsName();
        echo '&nbsp;';
        if ($this->osimage->hasSoftPack() && $this->infoCircle) {
            $this->generateInfoCircle();
        }
    }
675020
public function run()
    {
        foreach ($this->getSteps() as $step) {
            $this->logger->info('Starting "'.$step->getTitle().'"');

            foreach ($this->getServersForStep($step) as $server) {
                if ($step->isMandatory()) {
                    $server->runCommands();
                    $this->logger->info('Finished "'.$step->getTitle().'" on "'.$server->getTitle().'"');
                } else {
                    try {
                        $server->runCommands();
                        $this->logger->info('Finished "'.$step->getTitle().'" on "'.$server->getTitle().'"');
                    } catch (\Exception $e) {
                        $this->logger->info('Failed to run "'.$step->getTitle().'" on "'.$server->getTitle().'"');
                    }
                }
            }
        }
    }
427240
public function run()
    {
        Scripts::initializeClassLoader($this);
        Scripts::initializeSignalSlot($this);
        Scripts::initializePackageManagement($this);

        $this->activeRequestHandler = $this->resolveRequestHandler();
        $this->activeRequestHandler->handleRequest();
    }
722353
public function run()
    {
        if (!isset($this->parts['{visible}'])) {
            $this->renderVisible();
        }
        if (!isset($this->parts['{button}'])) {
            $this->renderSpoiled();
        }
        if (!isset($this->parts['{hidden}'])) {
            $this->renderHidden();
        }

        echo strtr($this->template, $this->parts);
    }
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);
            }
        }
    }
547916
def main(self):
        
        self.loop = urwid.MainLoop(self.top, self.palettes[self.palette_names[0]], screen=self.tui,
                                   handle_mouse=False, input_filter=self.handle_keys,
                                   unhandled_input=self.unhandled)
        self.loop.run()
516471
public function run()
    {
        $this->isRan = true;
        foreach ($this->headerList as $sHeader) {
            header($sHeader);
        }
    }
1272125
public function run()
    {
        // Creates the current controller instance
        $this->controller = new $this->controller($this->twig);

        // Calls the action method on the controller
        $response = call_user_func([$this->controller, $this->action]);

        // Shows the response
        echo $response;
    }
182319
def main(self, args):
        '''

        '''
        if args.action:
            self.runcmd(args.action, args.arguments)
        else:
            self.cmdloop()
284139
public function run()
    {
        $files     = $this->artDir($this->art);
        $animation = [];

        foreach ($files as $file) {
            $animation[] = $this->parse($file);
        }

        $this->animate($animation);
    }
1251478
def run(main=None, argv=None):
    """"""

    # Define help flags.
    _define_help_flags()

    # Parse known flags.
    argv = flags.FLAGS(_sys.argv if argv is None else argv, known_only=True)

    main = main or _sys.modules['__main__'].main

    # Call the main function, passing through any arguments
    # to the final program.
    _sys.exit(main(argv))
171217
protected function runMain()
    {
        $startTS = microtime_float();

        $searchEngine = new eZSolr();

        $processLimit = min( $this->Options['conc'] ? $this->Options['conc'] : 2,
                             10 ); // Maximum 10 processes
        $useFork = ( $processLimit > 1 &&
                     function_exists( 'pcntl_fork' ) &&
                     function_exists( 'posix_kill' ) );
        if ( $useFork )
        {
            $this->CLI->output( 'Using fork.' );
        }
        else
        {
            $processLimit = 1;
        }

        $this->CLI->output( 'Using ' . $processLimit . ' concurent process(es)' );

        $processList = array();
        for ( $i = 0; $i < $processLimit; $i++ )
        {
            $processList[$i] = -1;
        }

        $this->ObjectCount = $this->objectCount();
        $this->CLI->output( 'Number of objects to index: ' . $this->ObjectCount );
        $this->Script->resetIteration( $this->ObjectCount, 0 );

        $topNodeArray = eZPersistentObject::fetchObjectList(
            eZContentObjectTreeNode::definition(),
            null,
            array( 'parent_node_id' => 1, 'depth' => 1 )
        );
        // Loop through top nodes.
        foreach ( $topNodeArray as $node )
        {
            $nodeID = $node->attribute( 'node_id' );
            $offset = 0;

            $subtreeCount = $node->subTreeCount( array( 'Limitation' => array(), 'MainNodeOnly' => true ) );
            // While $offset < subtree count, loop through the nodes.
            while( $offset < $subtreeCount )
            {
                // Loop trough the available processes, and see if any has finished.
                for ( $i = 0; $i < $processLimit; $i++ )
                {
                    $pid = $processList[$i];
                    if ( $useFork )
                    {
                        if ( $pid === -1 || !posix_kill( $pid, 0 ) )
                        {
                            $newPid = $this->forkAndExecute( $nodeID, $offset, $this->Limit );
                            $this->CLI->output( "\n" . 'Creating a new thread: ' . $newPid );
                            if ( $newPid > 0 )
                            {
                                $offset += $this->Limit;
                                $this->iterate();
                                $processList[$i] = $newPid;
                            }
                            else
                            {
                                $this->CLI->error( "\n" . 'Returned invalid PID: ' . $newPid );
                            }
                        }
                    }
                    else
                    {
                        // Execute in same process
                        $this->CLI->output( "\n" . 'Starting a new batch' );
                        $count = $this->execute( $nodeID, $offset, $this->Limit );
                        $this->iterate( $count );
                        $offset += $this->Limit;
                    }

                    if ( $offset >= $subtreeCount )
                    {
                        break;
                    }
                }

                // If using fork, the main process must sleep a bit to avoid
                // 100% cpu usage. Sleep for 100 millisec.
                if ( $useFork )
                {
                    $status = 0;
                    pcntl_wait( $status, WNOHANG );
                    usleep( 100000 );
                }
            }
        }

        // Wait for all processes to finish.
        $break = false;
        while ( $useFork && !$break )
        {
            $break = true;
            for ( $i = 0; $i < $processLimit; $i++ )
            {
                $pid = $processList[$i];
                if ( $pid !== -1 )
                {
                    // Check if process is still alive.
                    if ( posix_kill( $pid, 0 ) )
                    {
                        $break = false;
                    }
                    else
                    {
                        $this->CLI->output( 'Process finished: ' . $pid );
                        $processList[$i] = -1;
                    }
                }
            }
            // Sleep for 500 msec.
            $status = 0;
            pcntl_wait( $status, WNOHANG );

            usleep( 500000 );
        }

        $this->CLI->output( 'Optimizing. Please wait ...' );
        $searchEngine->optimize( true );
        $endTS = microtime_float();

        $this->CLI->output(
            'Indexing took ' . ( $endTS - $startTS ) . ' secs ' .
            '( average: ' . ( $this->ObjectCount / ( $endTS - $startTS ) ) . ' objects/sec )'
        );

        $this->CLI->output( 'Finished updating the search index.' );
    }
721712
public function run()
    {
        //Update process state.
        static::$_status = static::STATUS_RUNNING;

        // Register shutdown function for checking errors.
        register_shutdown_function(array("\\Workerman\\Worker", 'checkErrors'));

        // Set autoload root path.
        Autoloader::setRootPath($this->_autoloadRootPath);

        // Create a global event loop.
        if (!static::$globalEvent) {
            $event_loop_class = static::getEventLoopName();
            static::$globalEvent = new $event_loop_class;
            $this->resumeAccept();
        }

        // Reinstall signal.
        static::reinstallSignal();

        // Init Timer.
        Timer::init(static::$globalEvent);

        // Set an empty onMessage callback.
        if (empty($this->onMessage)) {
            $this->onMessage = function () {};
        }

        restore_error_handler();
        
        // Try to emit onWorkerStart callback.
        if ($this->onWorkerStart) {
            try {
                call_user_func($this->onWorkerStart, $this);
            } catch (\Exception $e) {
                static::log($e);
                // Avoid rapid infinite loop exit.
                sleep(1);
                exit(250);
            } catch (\Error $e) {
                static::log($e);
                // Avoid rapid infinite loop exit.
                sleep(1);
                exit(250);
            }
        }

        // Main loop.
        static::$globalEvent->loop();
    }
1362720
def run(self):
        """"""
        args = []
        for arg in self.args:
            args.append(arg)
        Pyro.naming.main(args)
275121
public function run()
	{
		$this->renderContent();
		$content=ob_get_clean();
		if($this->hideOnEmpty && trim($content)==='')
			return;
		echo $this->_openTag;
		echo $content;
		echo "</div>\n";
		echo CHtml::closeTag($this->tagName);
	}