public function registerJob(string $jobName, callable $callback) : bool
    {
        $this->callbacks[$jobName] = $callback;
        $this->jobSocket->subscribe($jobName);

        // register job at server:
        $this->replySocket->send(json_encode([
            'request' => 'register_job',
            'worker_id' => $this->workerId,
            'job_name' => $jobName
        ]));
        $response = $this->replySocket->recv();
        return ($response === 'ok');
    }