/** * Execute a job * * @access public * @param Job $job */ public function executeJob(Job $job) { $payload = $job->getBody(); $className = $payload['class']; $this->prepareJobSession($payload['user_id']); if (DEBUG) { $this->logger->debug(__METHOD__ . ' Received job => ' . $className . ' (' . getmypid() . ')'); } $worker = new $className($this->container); call_user_func_array(array($worker, 'execute'), $payload['params']); }
/** * Execute a job * * @access public * @param Job $job */ public function executeJob(Job $job) { $payload = $job->getBody(); try { $className = $payload['class']; $this->prepareJobSession($payload['user_id']); $this->prepareJobEnvironment(); if (DEBUG) { $this->logger->debug(__METHOD__ . ' Received job => ' . $className . ' (' . getmypid() . ')'); $this->logger->debug(__METHOD__ . ' => ' . json_encode($payload)); } $worker = new $className($this->container); call_user_func_array(array($worker, 'execute'), $payload['params']); } catch (Exception $e) { $this->logger->error(__METHOD__ . ': Error during job execution: ' . $e->getMessage()); $this->logger->error(__METHOD__ . ' => ' . json_encode($payload)); } }
/** * Mark a job as failed * * @access public * @param Job $job * @return $this */ public function failed(Job $job) { $this->disque->queue($this->queueName)->failed(new DisqueJob($job->getBody(), $job->getId())); return $this; }
/** * Mark a job as failed * * @access public * @param Job $job * @return $this */ public function failed(Job $job) { $beanstalkJob = new BeanstalkJob($job->getId(), $job->serialize()); $this->beanstalk->bury($beanstalkJob); return $this; }
/** * Mark a job as failed * * @access public * @param Job $job * @return $this */ public function failed(Job $job) { $this->sqsClient->changeMessageVisibility(array('QueueUrl' => $this->sqsUrl, 'ReceiptHandle' => $job->getId(), 'VisibilityTimeout' => 0)); return $this; }
/** * Mark a job as failed * * @access public * @param Job $job * @return $this */ public function failed(Job $job) { $this->queue->enqueue($job->serialize()); return $this; }
/** * Mark a job as failed * * @access public * @param Job $job * @return $this */ public function failed(Job $job) { $this->channel->basic_nack($job->getId()); return $this; }