From c505d625336b9cdbacdd2468e491ce37b763bce9 Mon Sep 17 00:00:00 2001 From: Konstantin Grachev Date: Wed, 15 Sep 2021 01:26:00 +0300 Subject: [PATCH] Add logging on Consumer disconnected --- src/Consumer.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Consumer.php b/src/Consumer.php index 81a58ff..73edd9e 100644 --- a/src/Consumer.php +++ b/src/Consumer.php @@ -99,7 +99,7 @@ final class Consumer extends Connection yield $this->rdy(1); - /** @phpstan-ignore-next-line */ + /** @phpstan-ignore-next-line */ asyncCall(function () use ($buffer): \Generator { while (null !== $chunk = yield $this->stream->read()) { $buffer->append($chunk); @@ -130,6 +130,12 @@ final class Consumer extends Connection } } + $this->logger->debug('Consumer disconnected.', [ + 'address' => $this->address, + 'topic' => $this->topic, + 'channel' => $this->channel, + ]); + $this->stream = new NullStream(); }); });