From 73d6ef982614aa279bf5dfb24c1c5b02d42c7022 Mon Sep 17 00:00:00 2001 From: "Roland Franssen :)" Date: Wed, 22 Nov 2023 19:04:35 +0100 Subject: [PATCH 1/2] Enable on-demand consumer update --- src/Consumer/Consumer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Consumer/Consumer.php b/src/Consumer/Consumer.php index 5f0cb9f..39d6555 100644 --- a/src/Consumer/Consumer.php +++ b/src/Consumer/Consumer.php @@ -195,6 +195,6 @@ public function setIterations(int $iterations): self private function shouldCreateConsumer(bool $ifNotExists): bool { return ($this->configuration->isEphemeral() && $this->configuration->getName() === null) - || !$this->exists(); + || !$this->exists() || !$ifNotExists; } } From 0b772c3769d0e65a3aed0596720eb6bd151d6830 Mon Sep 17 00:00:00 2001 From: "Roland Franssen :)" Date: Wed, 22 Nov 2023 19:16:30 +0100 Subject: [PATCH 2/2] Update Consumer.php --- src/Consumer/Consumer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Consumer/Consumer.php b/src/Consumer/Consumer.php index 39d6555..794932f 100644 --- a/src/Consumer/Consumer.php +++ b/src/Consumer/Consumer.php @@ -41,6 +41,11 @@ public function create($ifNotExists = true): self return $this; } + public function update(): self + { + return $this->create(false); + } + public function delete(): self { $this->client->api('CONSUMER.DELETE.' . $this->getStream() . '.' . $this->getName());