From e0fd98410d2020fac0856d794ae5160ec2315e08 Mon Sep 17 00:00:00 2001 From: Ryan Summers Date: Mon, 1 Jul 2024 15:16:59 +0200 Subject: [PATCH] Updating messages iterator --- aiomqtt/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aiomqtt/client.py b/aiomqtt/client.py index b88672c..c59ef8e 100644 --- a/aiomqtt/client.py +++ b/aiomqtt/client.py @@ -238,7 +238,6 @@ def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915 if max_queued_incoming_messages is None: max_queued_incoming_messages = 0 self._queue = queue_type(maxsize=max_queued_incoming_messages) - self.messages = self._messages() # Semaphore to limit the number of concurrent outgoing calls self._outgoing_calls_sem: asyncio.Semaphore | None @@ -321,6 +320,10 @@ def __init__( # noqa: C901, PLR0912, PLR0913, PLR0915 timeout = 10 self.timeout = timeout + @property + def messages(self) -> AsyncGenerator[Message, None]: + return self._messages() + @property def identifier(self) -> str: """Return the client identifier.