Esempio n. 1
0
 /**
  * Called when Exception is catched during workload processing.
  *
  * @param \Riverline\WorkerBundle\Queue\Queue $queue
  * @param \Exception                          $exception
  * @return int
  */
 protected function onException(Queue $queue, \Exception $exception)
 {
     $this->getOutput()->writeln("Exception during workload processing for queue {$queue->getName()}. Class=" . get_class($exception) . ". Message={$exception->getMessage()}. Code={$exception->getCode()}");
     return WorkerControlCodes::STOP_EXECUTION;
 }
 public function testTimeout()
 {
     $tic = time();
     $this->queue->get(5);
     $this->assertGreaterThan(5, time() - $tic);
 }