Graceful restart
@return void
180893
public function gracefulRestart()
    {
        $this->graceful = true;
        $this->reload = true;
        Timer::add(function () {
            EventLoop::$instance->stop();
        }, $this->reloadDelay * 1e6);
        $this->setState($this->state);
    }
626512
public function restart()
    {
        $process = $this->getProcess([
            'restart',
            $this->name,
        ]);

        $process->run();

        if (!$process->isSuccessful()) {
            throw new CommandFailedException($process);
        }
    }
583663
public function reset()
    {
        ini_set('display_errors', '0');
        error_reporting(E_ALL);

        ini_set('zend.assertions', '1');
        ini_set('assert.exception', '1');

        $GLOBALS = $this->prepareGlobalForRetrieval($this->globals);
        $_ENV = $this->prepareGlobalForRetrieval($this->env);
        $_GET = $this->prepareGlobalForRetrieval($this->get);
        $_POST = $this->prepareGlobalForRetrieval($this->post);
        $_COOKIE = $this->prepareGlobalForRetrieval($this->cookie);
        $_SERVER = $this->prepareGlobalForRetrieval($this->server);
        $_SESSION = $this->prepareGlobalForRetrieval($this->session);
        $_FILES = $this->prepareGlobalForRetrieval($this->files);
        $_REQUEST = $this->prepareGlobalForRetrieval($this->request);
    }
574681
public function rebootKernel()
    {
        if ($this->container) {
            foreach ($this->persistentServices as $serviceName => $service) {
                if ($this->container->has($serviceName)) {
                    $this->persistentServices[$serviceName] = $this->container->get($serviceName);
                }
            }
        }

        $this->kernel->shutdown();
        $this->kernel->boot();
        $this->container = $this->kernel->getContainer();

        foreach ($this->persistentServices as $serviceName => $service) {
            try {
                $this->container->set($serviceName, $service);
            } catch (\InvalidArgumentException $e) {
                //Private services can't be set in Symfony 4
                codecept_debug("[Symfony] Can't set persistent service $serviceName: " . $e->getMessage());
            }
        }

        if ($this->container->has('profiler')) {
            $this->container->get('profiler')->enable();
        }
    }
439063
public function run()
    {

        try {
            // register shutdown handler
            register_shutdown_function($this->getDefaultShutdownMethod());

            // bootstrap the daemon
            $this->bootstrap();

            // mark the daemon as successfully shutdown
            $this->synchronized(function ($self) {
                $self->state = EnumState::get(EnumState::RUNNING);
            }, $this);

            // keep the daemon running
            while ($this->keepRunning()) {
                try {
                    $this->iterate($this->getDefaultTimeout());
                } catch (\Exception $e) {
                    $this->log(LogLevel::ERROR, $e->__toString());
                }
            }

            // clean up the instances and free memory
            $this->cleanUp();

            // mark the daemon as successfully shutdown
            $this->synchronized(function ($self) {
                $self->state = EnumState::get(EnumState::SHUTDOWN);
            }, $this);

        } catch (\Exception $e) {
            $this->log(LogLevel::ERROR, $e->__toString());
        }
    }
794774
public function gracefulShutdown()
    {
        if ((!$this->route) || $this->route->gracefulShutdown()) {
            $this->finish();
            return true;
        }
        return false;
    }
361645
def restart(self, *args, **kw):
        """"""
        self.stop()
        self.start(*args, **kw)
1143149
public function restartSlaves()
    {
        if ($this->inRestart) {
            return;
        }

        $this->inRestart = true;

        $this->closeSlaves();
        $this->createSlaves();

        $this->inRestart = false;
    }
213793
public function reset()
    {
        $this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
        $this->_browser_name = self::BROWSER_UNKNOWN;
        $this->_version = self::VERSION_UNKNOWN;
        $this->_platform = self::PLATFORM_UNKNOWN;
        $this->_os = self::OPERATING_SYSTEM_UNKNOWN;
        $this->_is_aol = false;
        $this->_is_mobile = false;
        $this->_is_robot = false;
        $this->_aol_version = self::VERSION_UNKNOWN;
    }
819681
protected function reset()
    {
        $this->parameters = [];
        $this->instances  = [];
        $this->services   = [];

        static::$instance = null;
        unset(static::$instance);
    }
515416
protected function reset()
    {
        $this->_agent = '';
        $this->_browserName = self::BROWSER_UNKNOWN;
        $this->_compatibilityViewName = '';
        $this->_compatibilityViewVer = '';
        $this->_is64bit = false;
        $this->_isMobile = false;
        $this->_isRobot = false;
        $this->_platform = self::PLATFORM_UNKNOWN;
        $this->_platformVersion = self::PLATFORM_VERSION_UNKNOWN;
        $this->_version = self::VERSION_UNKNOWN;
    }
577451
public function restart()
	{
		$this->destroy();

		if ($this->getState() !== 'destroyed')
		{
			// @TODO :: generated error here
			return false;
		}

		// Re-register the session handler after a session has been destroyed, to avoid PHP bug
		$this->store->register();

		$this->setState('restart');

		// Regenerate session id
		session_regenerate_id(true);
		$this->_start();
		$this->setState('active');

		$this->_validate();
		$this->_setCounter();

		return true;
	}
1077625
public function runAndReload()
    {

        // start supervisor and reload configuration
        $commands = [];
        $commands[] = sprintf(' && %s', $this->createSupervisorControlCommand('reread'));
        $commands[] = sprintf(' && %s', $this->createSupervisorControlCommand('update'));
        $this->run(implode('', $commands));
    }
689766
protected function boot()
    {
        if ($this->booted) {
            return;
        }

        fire_callbacks($this->bootCallbacks, $this);

        $this->booted = true;
    }
865022
public function engineRestart()
    {
        $this->executeCommandHook(__FUNCTION__, 'before');
        $this->executeExistingCommand('env:restart');
        $this->executeCommandHook(__FUNCTION__, 'after');

        return $this;
    }
36173
protected function startup()
    {
        $this->host->cleanup();
        $this->cleanup();
        $this->register();

        $cleaned = Job::cleanup($this->queues);
        if ($cleaned['zombie']) {
            $this->log('Failed <pop>'.$cleaned['zombie'].'</pop> zombie job'.($cleaned['zombie'] == 1 ? '' : 's'), Logger::NOTICE);
        }
        if ($cleaned['processed']) {
            $this->log('Cleared <pop>'.$cleaned['processed'].'</pop> processed job'.($cleaned['processed'] == 1 ? '' : 's'), Logger::NOTICE);
        }

        $this->setStatus(self::STATUS_RUNNING);

        Event::fire(Event::WORKER_STARTUP, $this);
    }
879376
final public function bootstrap() : void
    {
        foreach ([SIGINT, SIGTERM] as $sig) {
            SWProcess::signal($sig, function (int $sig) {
                $this->backend->shutdown($sig);
            });
        }
    }