Exemplo n.º 1
0
 public function onLookup(QueueLookupEvent $event)
 {
     try {
         $result = $this->gateway->selectQuery()->start()->filterByJob($event->getJobId())->limit(1)->end()->findOne();
         if (count($result) > 0) {
             $event->setResult($result);
         }
     } catch (DBALGatewayException $e) {
         throw new LaterJobException($e->getMessage(), 0, $e);
     }
 }
Exemplo n.º 2
0
 public function testQueueLookupEvent()
 {
     $job_id = '4b336e15-cac0-3307-8b81-f1de26e6c383';
     $result = $this->getMock('LaterJob\\Model\\Queue\\Storage');
     $event = new QueueLookupEvent($job_id);
     $event->setResult($result);
     $this->assertEquals($result, $event->getResult());
     $this->assertEquals($job_id, $event->getJobId());
 }
Exemplo n.º 3
0
 /**
  *  Log events that occur from queue
  *
  *  @access public
  *  @param QueueLookupEvent $event 
  */
 public function logQueueLookupEvent(QueueLookupEvent $event)
 {
     $this->log->info('QueueLookupEvent:: Looking up Job with params', array('job_id' => $event->getJobId()));
 }
 /**
  *  Log events that occur from queue
  *
  *  @access public
  *  @param QueueLookupEvent $event 
  */
 public function logQueueLookupEvent(QueueLookupEvent $event)
 {
     $this->output->writeln('QueueLookupEvent:: Looking up Job with params' . json_encode(array('job_id' => $event->getJobId())));
 }