protected function handleJobRequest(
        string $clientAddress,
        string $jobName,
        string $payload = '',
        bool $backgroundJob = false
    ) : string {
        $jobId = $this->addJobToQueue($jobName, $payload);
        $this->jobTypes[$jobId] = ($backgroundJob === true) ? 'background' : 'normal';
        $this->jobAddresses[$jobId] = $clientAddress;
        $this->pushJobs();
        if ($backgroundJob === true) {
            $this->respondToClient($clientAddress, $jobId);
        }
        $this->totalJobRequests++;
        return $jobId;
    }
protected function handleJobRequest(
        string $clientAddress,
        string $jobName,
        string $payload = '',
        bool $backgroundJob = false
    ) : string {
        $jobId = $this->addJobToQueue($jobName, $payload);
        $this->jobTypes[$jobId] = ($backgroundJob === true) ? 'background' : 'normal';
        $this->jobAddresses[$jobId] = $clientAddress;
        $this->pushJobs();
        if ($backgroundJob === true) {
            $this->respondToClient($clientAddress, $jobId);
        }
        $this->totalJobRequests++;
        return $jobId;
    }
protected function handleJobRequest ( string $ clientAddress , string $ jobName , string $ payload = '' , bool $ backgroundJob = false ) : string { $ jobId = $ this -> addJobToQueue ( $ jobName , $ payload ) ; $ this -> jobTypes [ $ jobId ] = ( $ backgroundJob === true ) ? 'background' : 'normal' ; $ this -> jobAddresses [ $ jobId ] = $ clientAddress ; $ this -> pushJobs ( ) ; if ( $ backgroundJob === true ) { $ this -> respondToClient ( $ clientAddress , $ jobId ) ; } $ this -> totalJobRequests ++ ; return $ jobId ; }
Handles job-requests received from a client.

@param string $clientAddress
@param string $jobName
@param string $payload
@param bool $backgroundJob
@return string The id assigned to the job.
Handles job - requests received from a client .