Skip to content

Commit 7cd230e

Browse files
girtsfFlorianLudwig
authored andcommitted
Pass in loop to PluginManager
If `loop` is passed to `MQTTClient`, previously it was not passed down to `PluginManager`, which could potentially grab a different loop from `asyncio.get_event_loop()`, resulting in a separate event loop being created or wrong one being used. Now the `loop` argument is passed down as expected.
1 parent ab20841 commit 7cd230e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hbmqtt/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(self, client_id=None, config=None, loop=None):
112112
# Init plugins manager
113113
context = ClientContext()
114114
context.config = self.config
115-
self.plugins_manager = PluginManager('hbmqtt.client.plugins', context)
115+
self.plugins_manager = PluginManager('hbmqtt.client.plugins', context, loop=self._loop)
116116
self.client_tasks = deque()
117117

118118
async def connect(self,

0 commit comments

Comments
 (0)