コード例 #1
0
 /**
  * @inheritdoc
  */
 public function limitReached(Consumer $consumer)
 {
     if ($consumer->getProcessed() >= $this->limit) {
         throw LimitReachedException::withMessage(sprintf('Maximum number of messages consumed (%d)', $this->limit));
     }
 }
コード例 #2
0
 /**
  * @inheritdoc
  */
 public function limitReached(Consumer $consumer)
 {
     if ($consumer->getDuration() >= $this->maxTime) {
         throw LimitReachedException::withMessage(sprintf('Maximum execution time of %ds reached', $this->maxTime));
     }
 }