Add logging on Consumer disconnected

This commit is contained in:
2021-09-15 01:26:00 +03:00
parent f3f67bedd3
commit c505d62533

View File

@ -99,7 +99,7 @@ final class Consumer extends Connection
yield $this->rdy(1); yield $this->rdy(1);
/** @phpstan-ignore-next-line */ /** @phpstan-ignore-next-line */
asyncCall(function () use ($buffer): \Generator { asyncCall(function () use ($buffer): \Generator {
while (null !== $chunk = yield $this->stream->read()) { while (null !== $chunk = yield $this->stream->read()) {
$buffer->append($chunk); $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(); $this->stream = new NullStream();
}); });
}); });