public function killChild()
{
if (is_null($this->child)) {
return;
}
if ($this->child === 0) {
throw new Exception\Shutdown('Job forced shutdown');
}
Event::fire(Event::WORKER_KILLCHILD, array($this, $this->child));
if (posix_kill($this->child, 0)) {
$this->log('Killing child process at pid:' . $this->child, Logger::DEBUG);
posix_kill($this->child, SIGTERM);
}
$this->child = null;
}