/** * @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 ($consumer->getDuration() >= $this->maxTime) { throw LimitReachedException::withMessage(sprintf('Maximum execution time of %ds reached', $this->maxTime)); } }