Ejemplo n.º 1
0
 /**
  * Send a new job to the queue
  *
  * @access public
  * @param  BaseJob $job
  * @return $this
  */
 public function push(BaseJob $job)
 {
     if ($this->queue !== null) {
         $this->queue->push(JobHandler::getInstance($this->container)->serializeJob($job));
     } else {
         call_user_func_array(array($job, 'execute'), $job->getJobParams());
     }
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Send a new job to the queue
  *
  * @access public
  * @param  BaseJob $job
  * @return $this
  */
 public function push(BaseJob $job)
 {
     $jobClassName = get_class($job);
     if ($this->queue !== null) {
         $this->logger->debug(__METHOD__ . ': Job pushed in queue: ' . $jobClassName);
         $this->queue->push(JobHandler::getInstance($this->container)->serializeJob($job));
     } else {
         $this->logger->debug(__METHOD__ . ': Job executed synchronously: ' . $jobClassName);
         call_user_func_array(array($job, 'execute'), $job->getJobParams());
     }
     return $this;
 }