protected function sendSignal($signalNumber)
    {
        if (! $this->context->isRunning || ! $this->context->processId) {
            return false;
        }

        $result = $this->control->signal()->send($signalNumber, $this->context->processId);
        if (in_array($signalNumber, [SIGTERM, SIGKILL])) {
            $this->context->isRunning = false;
            $this->context->processId = null;
        }

        return $result;
    }