Aerys\Process::start PHP Method

start() public method

Start the process
public start ( Console $console ) : Generator
$console Console
return Generator
    public function start(Console $console) : \Generator
    {
        try {
            if ($this->state) {
                throw new \LogicException("A process may only be started once");
            }
            $this->registerSignalHandler();
            $this->registerShutdownHandler();
            $this->registerErrorHandler();
            $this->state = self::STARTED;
            yield from $this->doStart($console);
            // Once we make it this far we no longer want to terminate
            // the process in the event of an uncaught exception inside
            // the event reactor -- log it instead.
            \Amp\onError([$this->logger, "critical"]);
        } catch (\Throwable $uncaught) {
            $this->exitCode = 1;
            $this->logger->critical($uncaught);
            static::exit();
        }
    }