public function updatePidFile() : void
    {
        $pidFolder = $this->getRunPath($this->poolName);
        if (!file_exists($pidFolder)) {
            mkdir($pidFolder, 0755, true);
        }
        $pidFile = $pidFolder . '/' . $this->workerName . '.pid';
        $pid = getmypid();
        if (file_put_contents($pidFile, $pid) === false) {
            throw new WorkerException('Could not create PID file.');
        }
    }