/**
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return int|null|void
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->writeSection($output, 'EloGank - League of Legends API');
     $apiManager = new ApiManager();
     try {
         $server = new Server($apiManager);
         $server->listen();
     } catch (\Exception $e) {
         $this->getApplication()->renderException($e, $output);
         $apiManager->getLogger()->critical($e);
         $apiManager->clean();
         // Need to be killed manually, see ReactPHP issue: https://github.com/reactphp/react/issues/296
         posix_kill(getmypid(), SIGKILL);
     }
 }