src/Jobs/BaseJob.php
public function complete(?string $nextq = null, int $delay = 0, array $depends = []): string
    {
        if ($this->completed || $this->failed) {
            throw new JobAlreadyFinishedException();
        }

        $params = [
            $this->jid,
            $this->worker,
            $this->queue,
            json_encode($this->data, JSON_UNESCAPED_SLASHES) ?: '{}'
        ];

        if ($nextq) {
            $next = ['next', $nextq, 'delay', $delay, 'depends', json_encode($depends, JSON_UNESCAPED_SLASHES)];
            $params = array_merge($params, $next);
        }

        $this->completed = true;

        return call_user_func_array(
            [$this->client, 'complete'],
            $params
        );
    }
public function complete(?string $nextq = null, int $delay = 0, array $depends = []): string
    {
        if ($this->completed || $this->failed) {
            throw new JobAlreadyFinishedException();
        }

        $params = [
            $this->jid,
            $this->worker,
            $this->queue,
            json_encode($this->data, JSON_UNESCAPED_SLASHES) ?: '{}'
        ];

        if ($nextq) {
            $next = ['next', $nextq, 'delay', $delay, 'depends', json_encode($depends, JSON_UNESCAPED_SLASHES)];
            $params = array_merge($params, $next);
        }

        $this->completed = true;

        return call_user_func_array(
            [$this->client, 'complete'],
            $params
        );
    }
Complete a job and optionally put it in another queue,
either scheduled or to be considered waiting immediately.

Like Queue::put and Queue::move, it accepts a delay, and dependencies.

@see \Qless\Queues\Queue::put

@param  string|null $nextq
@param  int         $delay
@param  array       $depends
@return string