public function put($name, array $options = null, $queue = null, \DateTime $when = null, $trackStatus = false)
    {
        if ($this->debug) {
            return;
        }

        if (!$queue) {
            $queue = $this->defaultQueue;
        }

        $args = array_merge([
            'name' => $name,
            'options' => $options,
        ], $this->kernelOptions);

        $trackJobStatus = $trackStatus || $this->trackStatus;

        if ($when) {
            \ResqueScheduler::enqueueAt($when, $queue, Job::class, $args, $trackJobStatus);

            return new JobDescription($when, $queue, Job::class, $args, $trackJobStatus);
        } else {
            $id = \Resque::enqueue($queue, Job::class, $args, $trackJobStatus);

            return new JobDescription(null, $queue, Job::class, $args, $trackJobStatus, $id);
        }
    }
public function put($name, array $options = null, $queue = null, \DateTime $when = null, $trackStatus = false)
    {
        if ($this->debug) {
            return;
        }

        if (!$queue) {
            $queue = $this->defaultQueue;
        }

        $args = array_merge([
            'name' => $name,
            'options' => $options,
        ], $this->kernelOptions);

        $trackJobStatus = $trackStatus || $this->trackStatus;

        if ($when) {
            \ResqueScheduler::enqueueAt($when, $queue, Job::class, $args, $trackJobStatus);

            return new JobDescription($when, $queue, Job::class, $args, $trackJobStatus);
        } else {
            $id = \Resque::enqueue($queue, Job::class, $args, $trackJobStatus);

            return new JobDescription(null, $queue, Job::class, $args, $trackJobStatus, $id);
        }
    }
public function put ( $ name , array $ options = null , $ queue = null , \ DateTime $ when = null , $ trackStatus = false ) { if ( $ this -> debug ) { return ; } if ( ! $ queue ) { $ queue = $ this -> defaultQueue ; } $ args = array_merge ( [ 'name' => $ name , 'options' => $ options , ] , $ this -> kernelOptions ) ; $ trackJobStatus = $ trackStatus || $ this -> trackStatus ; if ( $ when ) { \ ResqueScheduler :: enqueueAt ( $ when , $ queue , Job :: class , $ args , $ trackJobStatus ) ; return new JobDescription ( $ when , $ queue , Job :: class , $ args , $ trackJobStatus ) ; } else { $ id = \ Resque :: enqueue ( $ queue , Job :: class , $ args , $ trackJobStatus ) ; return new JobDescription ( null , $ queue , Job :: class , $ args , $ trackJobStatus , $ id ) ; } }
Put a new job on a queue.

@param string    $name        The service name of the worker that implements {@link \Mcfedr\ResqueBundle\Worker\WorkerInterface}
@param array     $options     Options to pass to execute - must be json serializable
@param string    $queue       Optional queue name, otherwise the default queue will be used
@param \DateTime $when        Optionally set a time in the future when this task should happen
@param bool      $trackStatus Set to true to be able to monitor the status of a job

@return JobDescription
Put a new job on a queue .