Exemple #1
0
 public function onMessageConsumed(MessageConsumedEvent $event)
 {
     /// @todo this might give php warnings
     ///       We could also check if Symfony\Component\VarDumper is available and use it instead...
     if (class_exists('Doctrine\\Common\\Util\\Debug')) {
         echo "Message finished consumption at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . \Doctrine\Common\Util\Debug::dump($event->getConsumptionResult(), 2, false, false) . "\n";
     } else {
         echo "Message finished consumption at " . strftime('%Y/%m/%d - %H:%M:%S', time()) . ": " . var_export($event->getConsumptionResult(), true) . "\n";
     }
 }
 public function onMessageConsumed(MessageConsumedEvent $event)
 {
     $results = $event->getConsumptionResult();
     if (!is_array($results) || count($results) != 3) {
         // this consumption result is not the outptut of a consolecommand consumer!
         return;
     }
     $retCode = $results[0];
     if ($retCode != 0) {
         $body = $event->getBody();
         $this->messageProducer->publish($body['command'], isset($body['arguments']) ? $body['arguments'] : array(), isset($body['options']) ? $body['options'] : array(), $this->key, $this->ttl);
     }
 }
 public function onMessageConsumed(MessageConsumedEvent $event)
 {
     $this->results[] = $event->getConsumptionResult();
 }