jasonrbriggs / stomp.py

“stomp.py” is a Python client library for accessing messaging servers (such as ActiveMQ or RabbitMQ) using the STOMP protocol (versions 1.0, 1.1 and 1.2). It can also be run as a standalone, command-line client for testing.
Apache License 2.0
491 stars 167 forks source link

fix heartbeats stop after disconnect reconnect #388

Closed hugobrilhante closed 2 years ago

hugobrilhante commented 2 years ago

The motivation for this modification is to resolve the issue reported in #351. Recreating the event in the __heartbeat_loop ensures that we will not have an event defined by on_disconnect. I did this because for some reason the .clear() event is not working as it should and it sets the terminate variable to True constantly preventing the __heartbeat_loop from starting after a disconnect. I removed running because using the event made it unnecessary, at least in my view.

Closes: #351

hugobrilhante commented 2 years ago

I couldn't reproduce the tests