-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stop
s when connect fails
#104
Comments
Not sure if this is related to #84 |
@ryanwinchester Thank you for using emqtt. In general, if the connection fails for the first time, it means that the server has not been started or there are other problems, so we think it is reasonable to give the reconnection logic to the user. |
Thanks, I'll try to add more detail why it's harder to use this way: Stopping emqtt also stops my gen_server that is using it. So, now I have to:
Instead of just retrying Am I explaining my problem well enough? I'm not good at explaining sometimes. |
This issue is serious and my team will probably switch back to Elixir Tortoise because of it, even if the performance of emqtt were better.
When Returning |
I'm running into this as well. It's a bit of a headache to deal with the child terminating instead of getting a response from the |
Is there an intention to address this issue? It causes the whole app to exit immediately if the broker is not available during the startup. Alternatively, we have to turn to a hacky workaround. This is a big downside for an otherwise great library. |
I'm also curious - any plans to address this? |
I really hope this can be adressed. |
When connection fails you
stop_and_reply
https://github.com/emqx/emqtt/blob/master/src/emqtt.erl#L617-L630
but I would not like this to happen. Depending on the reason, I'd like to just try reconnecting with my own custom logic (like exponential backoff with jitter) but this makes it much more difficult to do. Wouldn't it be better to let the user of the library decide when they want to stop?
The text was updated successfully, but these errors were encountered: