think\Process::doSignal PHP Méthode

doSignal() private méthode

将一个 POSIX 信号发送到进程中。
private doSignal ( integer $signal, boolean $throwException ) : boolean
$signal integer
$throwException boolean
Résultat boolean
    private function doSignal($signal, $throwException)
    {
        if (!$this->isRunning()) {
            if ($throwException) {
                throw new \LogicException('Can not send signal on a non running process.');
            }
            return false;
        }
        if ($this->isSigchildEnabled()) {
            if ($throwException) {
                throw new \RuntimeException('This PHP has been compiled with --enable-sigchild. The process can not be signaled.');
            }
            return false;
        }
        if (true !== @proc_terminate($this->process, $signal)) {
            if ($throwException) {
                throw new \RuntimeException(sprintf('Error while sending signal `%s`.', $signal));
            }
            return false;
        }
        $this->latestSignal = $signal;
        return true;
    }