original_string: protected function stop()
      {
          $pid = $this->getCurrentPid();
  
          if (! $this->isRunning($pid)) {
              $this->error("Failed! There is no swoole_http_server process running.");
  
              return;
          }
  
          $this->info('Stopping swoole http server...');
  
          $isRunning = $this->killProcess($pid, SIGTERM, 15);
  
          if ($isRunning) {
              $this->error('Unable to stop the swoole_http_server process.');
  
              return;
          }
  
          // I don't known why Swoole didn't trigger "onShutdown" after sending SIGTERM.
          // So we should manually remove the pid file.
          $this->removePidFile();
  
          $this->info('> success');
      }
code: protected function stop()
      {
          $pid = $this->getCurrentPid();
  
          if (! $this->isRunning($pid)) {
              $this->error("Failed! There is no swoole_http_server process running.");
  
              return;
          }
  
          $this->info('Stopping swoole http server...');
  
          $isRunning = $this->killProcess($pid, SIGTERM, 15);
  
          if ($isRunning) {
              $this->error('Unable to stop the swoole_http_server process.');
  
              return;
          }
  
          // I don't known why Swoole didn't trigger "onShutdown" after sending SIGTERM.
          // So we should manually remove the pid file.
          $this->removePidFile();
  
          $this->info('> success');
      }
code_tokens: protected function stop ( ) { $ pid = $ this -> getCurrentPid ( ) ; if ( ! $ this -> isRunning ( $ pid ) ) { $ this -> error ( "Failed! There is no swoole_http_server process running." ) ; return ; } $ this -> info ( 'Stopping swoole http server...' ) ; $ isRunning = $ this -> killProcess ( $ pid , SIGTERM , 15 ) ; if ( $ isRunning ) { $ this -> error ( 'Unable to stop the swoole_http_server process.' ) ; return ; } // I don't known why Swoole didn't trigger "onShutdown" after sending SIGTERM. // So we should manually remove the pid file. $ this -> removePidFile ( ) ; $ this -> info ( '> success' ) ; }
docstring: Stop swoole_http_server.
docstring_tokens: Stop swoole_http_server .