public function kill($signal = SIGTERM)
    {
        if (!$this->isAlive()) {
            return false;
        }

        if (!proc_terminate($this->resource, $signal)) {
            return false;
        }

        $this->setStreamBlocking();

        while ($this->isAlive()) {
            usleep(50000);
        }

        $this->cleanup();
        return true;
    }
public function kill($signal = SIGTERM)
    {
        if (!$this->isAlive()) {
            return false;
        }

        if (!proc_terminate($this->resource, $signal)) {
            return false;
        }

        $this->setStreamBlocking();

        while ($this->isAlive()) {
            usleep(50000);
        }

        $this->cleanup();
        return true;
    }
public function kill ( $ signal = SIGTERM ) { if ( ! $ this -> isAlive ( ) ) { return false ; } if ( ! proc_terminate ( $ this -> resource , $ signal ) ) { return false ; } $ this -> setStreamBlocking ( ) ; while ( $ this -> isAlive ( ) ) { usleep ( 50000 ) ; } $ this -> cleanup ( ) ; return true ; }
Kill the running process.

@param int $signal

@return bool
@throws ProcessException
Kill the running process .