-
-
Notifications
You must be signed in to change notification settings - Fork 32
Support for auto connect when disconnect #6
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
Comments
@rogerhu that will reconnect only if you try to That said, you can write your own code that listens for network connectivity changes, and attempts to reconnect a LiveQueryClient when the device regains connectivity. |
Yeah do you want to take a stab at exponential backoff code ? :) |
^ That only helps if the disconnect happened as a result of the device losing connectivity. If the server goes down, there's no retry/reconnect. I wonder if we can add some kind of generic retry handler to the Parse Android SDK, and leverage that here. This does bring up another point though: the host app is never notified of any connect/disconnect events. So the app can't even know whether a I can't commit to working on a backoff handler right now, but if my schedule frees up today or tomorrow I'll follow up here. |
This has become higher priority for my team, so I'm going to work on two fixes:
|
This enables a partial fix/workaround for parse-community#6, which otherwise wouldn't even be possible in its current state. Future changes will allow the client to automatically reconnect when the connection has been broken for any reason other than explicit disconnect().
This enables a partial fix/workaround for parse-community#6, which otherwise wouldn't even be possible in its current state. Future changes will allow the client to automatically reconnect when the connection has been broken for any reason other than explicit disconnect().
This enables a partial fix/workaround for #6, which otherwise wouldn't even be possible in its current state. Future changes will allow the client to automatically reconnect when the connection has been broken for any reason other than explicit disconnect().
I've managed to get this working in my own project, by using the above referenced callbacks.
Eventually I'd like both of those to be supported natively in this library. If nothing else, I can just create standalone listeners for that, and if you want that behavior, you can register them yourself, rather than expect the client (which is currently lightweight) to do all this stuff automatically for you. |
@jhansche |
@monajafi sorry for not seeing this sooner. The way we resolved that in our app was by using the Simplistic version:
And in the Handler callback for |
Thanks for providing your solution. I've solved this way: |
Could you support auto connect?
Many thanks.
The text was updated successfully, but these errors were encountered: