I hope I am not duplicating #106 here, but while this isse has been resolved long time ago, I still get the mentioned error when I try to gracefully shutdown my program.
In a nutshell:
def main():
loop = asyncio.get_event_loop()
mq = mqtt.Mqtt() # my wrapper class
try:
loop.run_until_complete(mq.connect())
except KeyboardInterrupt:
pass
except Exception as e:
self.log.error("Got exception: {}".format(e))
finally:
loop.run_until_complete(mq.disconnect())
loop.close()
Now when I do CTRL+C, it should interrupt the loop execution and call the stop-logic in the finally:-block, which will ultimately call unsubscribe/disconnect.
However I get the following exception:
future: <Task finished coro=<Mqtt.connect() done, defined at /Users/s710/Development/myapp/mqtt.py:59> exception=IndexError('pop from an empty deque')>
Traceback (most recent call last):
File "/Users/s710/Development/myapp/mqtt.py", line 67, in connect
message = await self.client.deliver_message()
File "/Users/s710/Development/myapp/venv/lib/python3.7/site-packages/hbmqtt/client.py", line 356, in deliver_message
self.client_tasks.pop()
IndexError: pop from an empty deque
Do I have some general misconception here (I am still new to asyncio programming), or can this error be ignored?
I hope I am not duplicating #106 here, but while this isse has been resolved long time ago, I still get the mentioned error when I try to gracefully shutdown my program.
In a nutshell:
class Mqtt
Now when I do
CTRL+C
, it should interrupt the loop execution and call the stop-logic in thefinally:
-block, which will ultimately callunsubscribe
/disconnect
.However I get the following exception:
Do I have some general misconception here (I am still new to asyncio programming), or can this error be ignored?