public function pull($timeout = 0)
{
$this->checkConnected();
$jobs = $this->client->getJob($this->name, ['timeout' => $timeout, 'count' => 1, 'withcounters' => true]);
if (empty($jobs)) {
return null;
}
$jobData = $jobs[0];
$job = $this->marshaler->unmarshal($jobData[Response::KEY_BODY]);
$job->setId($jobData[Response::KEY_ID]);
$job->setNacks($jobData[Counters::KEY_NACKS]);
$job->setAdditionalDeliveries($jobData[Counters::KEY_ADDITIONAL_DELIVERIES]);
return $job;
}