Open BojanSM opened 7 years ago
I am not familiar with the scheduler package that you are using. Is it from this repository : https://github.com/ReactiveX/RxJava ? If you use standard Java Timer, https://docs.oracle.com/javase/7/docs/api/java/util/Timer.html, you can cancel the timer in onSuccess() callback.
@BojanSM I have the same problem. How did you resolved it for your app?
+1
Exists also in 1.2.0
According to James's comment over here, this is not supported, but I need this functionality in our application. For example, on application startup, we didn't have network connection, but after 30 seconds or so, we established connection successfully so I want my client to connect automatically.
My question is - what would be best approach to accomplish this? What I tried so far is to try to reconnect if something goes wrong during
connect
method. And since we use RxJava I have scheduled execution of the same method which is responsible for client connection. It will be easier if I paste the code.What happens like this is that, when network connection is available I manage to connect automatically, but second thread is created which continues to retry to connect to broker. Does anyone already implemented this, or do you have any other suggestions?