Just a couple of things I've noticed, which are easy to fix:
- When there's a connection error, the client won't attempt to reconnect. This is because the "error" listener doesn't call
connection_gone. I'm not sure if this is intentional, but it might be useful if it tried reconnecting on error (such as ECONNREFUSED) after a disconnect.
client.attempts is never reset. It should probably be set back to 1 in client.on_connect. I'm assuming it's only needed for the exponential backoff, and therefore should be reset after a successful connection.
If you want me to submit a patch, I can do so, but it's really just two lines of code if you want to fix this.
Cheers
Just a couple of things I've noticed, which are easy to fix:
connection_gone. I'm not sure if this is intentional, but it might be useful if it tried reconnecting on error (such as ECONNREFUSED) after a disconnect.client.attemptsis never reset. It should probably be set back to1inclient.on_connect. I'm assuming it's only needed for the exponential backoff, and therefore should be reset after a successful connection.If you want me to submit a patch, I can do so, but it's really just two lines of code if you want to fix this.
Cheers