M6Web\Bundle\PhpProcessManagerBundle\Command\HttpProcessCommand::execute PHP Method

execute() protected method

{@inheritDoc}
See also: Symfony\Component\Console\Command\Command::execute()
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        // Start listenning
        $this->socket->listen($this->port, $this->host);
        // Periodically call determining if we should stop or not
        $this->loop->addPeriodicTimer($input->getOption('check-interval'), function () use($output) {
            if ($this->shouldExitCommand($output)) {
                $this->loop->stop();
                $this->writeln($output, 'Event loop stopped:' . $this->port);
                $this->returnValue = 10;
            }
        });
        // Main loop
        $this->writeln($output, 'Starting event loop:' . $this->port);
        $this->loop->run();
        return $this->returnValue;
    }