/**
  * @inheritdoc
  */
 public function limitReached(Consumer $consumer)
 {
     if ($consumer->getProcessed() >= $this->limit) {
         throw LimitReachedException::withMessage(sprintf('Maximum number of messages consumed (%d)', $this->limit));
     }
 }
 /**
  * @inheritdoc
  */
 public function limitReached(Consumer $consumer)
 {
     if (memory_get_usage(true) > $this->maxMemory) {
         throw LimitReachedException::withMessage(sprintf('Memory peak of %dMB reached', $this->maxMemory / 1024 / 1024));
     }
 }
 /**
  * @inheritdoc
  */
 public function limitReached(Consumer $consumer)
 {
     if ($consumer->getDuration() >= $this->maxTime) {
         throw LimitReachedException::withMessage(sprintf('Maximum execution time of %ds reached', $this->maxTime));
     }
 }