public function addJob($queue, Job $job, $maxlen = 0, $async = false)
    {
        $command = [
            'ADDJOB',
            $queue,
            $job->getBody(),
            $this->getReplicationTimeout(),
            'REPLICATE', $this->getReplicationFactor(),
            'DELAY', $job->getDelay(),
            'RETRY', $job->getRetry(),
            'TTL', $job->getTtL(),
        ];

        if ($maxlen) {
            $command[] = 'MAXLEN';
            $command[] = (int) $maxlen;
        }

        if ($async) {
            $command[] = 'ASYNC';
        }

        $id = $this->send($command);
        $job->setId($id);
        $job->setQueue($queue);
        return $job;
    }