src/Queues/Queue.php
public function put(
        string $className,
        array $data,
        ?string $jid = null,
        ?int $delay = null,
        ?int $retries = null,
        ?int $priority = null,
        ?array $tags = null,
        ?array $depends = null
    ) {
        try {
            $jid = $jid ?: str_replace('-', '', Uuid::uuid4()->toString());
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        }

        $data = new JobData($data);
        $this->getEventsManager()->fire(new QueueEvent\BeforeEnqueue($this, $jid, $data, $className));

        if (!$putData = json_encode($data, JSON_UNESCAPED_SLASHES)) {
            throw new RuntimeException(
                sprintf(
                    'Unable to encode payload to put the described job "%s" to the "%s" queue.',
                    $jid,
                    $this->name
                )
            );
        }

        $jid = $this->client->put(
            '',
            $this->name,
            $jid,
            $className,
            $putData,
            is_null($delay) ? 0 : $delay,
            'priority',
            is_null($priority) ? 0 : $priority,
            'tags',
            json_encode($tags ?: [], JSON_UNESCAPED_SLASHES),
            'retries',
            is_null($retries) ? 5 : $retries,
            'depends',
            json_encode($depends ?: [], JSON_UNESCAPED_SLASHES)
        );

        $this->getEventsManager()->fire(new QueueEvent\AfterEnqueue($this, $jid, $data->toArray(), $className));

        return $jid;
    }
public function put(
        string $className,
        array $data,
        ?string $jid = null,
        ?int $delay = null,
        ?int $retries = null,
        ?int $priority = null,
        ?array $tags = null,
        ?array $depends = null
    ) {
        try {
            $jid = $jid ?: str_replace('-', '', Uuid::uuid4()->toString());
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        }

        $data = new JobData($data);
        $this->getEventsManager()->fire(new QueueEvent\BeforeEnqueue($this, $jid, $data, $className));

        if (!$putData = json_encode($data, JSON_UNESCAPED_SLASHES)) {
            throw new RuntimeException(
                sprintf(
                    'Unable to encode payload to put the described job "%s" to the "%s" queue.',
                    $jid,
                    $this->name
                )
            );
        }

        $jid = $this->client->put(
            '',
            $this->name,
            $jid,
            $className,
            $putData,
            is_null($delay) ? 0 : $delay,
            'priority',
            is_null($priority) ? 0 : $priority,
            'tags',
            json_encode($tags ?: [], JSON_UNESCAPED_SLASHES),
            'retries',
            is_null($retries) ? 5 : $retries,
            'depends',
            json_encode($depends ?: [], JSON_UNESCAPED_SLASHES)
        );

        $this->getEventsManager()->fire(new QueueEvent\AfterEnqueue($this, $jid, $data->toArray(), $className));

        return $jid;
    }
public function put ( string $ className , array $ data , ? string $ jid = null , ? int $ delay = null , ? int $ retries = null , ? int $ priority = null , ? array $ tags = null , ? array $ depends = null ) { try { $ jid = $ jid ? : str_replace ( '-' , '' , Uuid :: uuid4 ( ) -> toString ( ) ) ; } catch ( \ Exception $ e ) { throw new RuntimeException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } $ data = new JobData ( $ data ) ; $ this -> getEventsManager ( ) -> fire ( new QueueEvent \ BeforeEnqueue ( $ this , $ jid , $ data , $ className ) ) ; if ( ! $ putData = json_encode ( $ data , JSON_UNESCAPED_SLASHES ) ) { throw new RuntimeException ( sprintf ( 'Unable to encode payload to put the described job "%s" to the "%s" queue.' , $ jid , $ this -> name ) ) ; } $ jid = $ this -> client -> put ( '' , $ this -> name , $ jid , $ className , $ putData , is_null ( $ delay ) ? 0 : $ delay , 'priority' , is_null ( $ priority ) ? 0 : $ priority , 'tags' , json_encode ( $ tags ? : [ ] , JSON_UNESCAPED_SLASHES ) , 'retries' , is_null ( $ retries ) ? 5 : $ retries , 'depends' , json_encode ( $ depends ? : [ ] , JSON_UNESCAPED_SLASHES ) ) ; $ this -> getEventsManager ( ) -> fire ( new QueueEvent \ AfterEnqueue ( $ this , $ jid , $ data -> toArray ( ) , $ className ) ) ; return $ jid ; }
Put the described job in this queue.

Either create a new job in the provided queue with the provided attributes,
or move that job into that queue. If the job is being serviced by a worker,
subsequent attempts by that worker to either `heartbeat` or `complete` the
job should fail and return `false`.

@param  string        $className The class with the job perform method.
@param  array         $data      An array of parameters for job.
@param  string|null   $jid       The specified job id, if not a specified, a jid will be generated.
@param  int|null      $delay     The specified delay to run job.
@param  int|null      $retries   Number of retries allowed.
@param  int|null      $priority  A greater priority will execute before jobs of lower priority.
@param  string[]|null $tags      An array of tags to add to the job.
@param  string[]|null $depends   A list of JIDs this job must wait on before executing.
@return string The job identifier.

@throws QlessException
@throws RuntimeException
Put the described job in this queue .