Skip to content

Reconnecting #7

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

Open
jvorcak opened this issue Mar 17, 2016 · 2 comments
Open

Reconnecting #7

jvorcak opened this issue Mar 17, 2016 · 2 comments

Comments

@jvorcak
Copy link
Contributor

jvorcak commented Mar 17, 2016

Hi,

I'd like to ask, how can I solve reconnecting issue using this library. Or should I do connect every time I want to make a call? That doesn't really make a sense when websockets are involved. When a server goes down, I'd expect a websocket to try to reconnect, or am I wrong?

@mikemintz
Copy link
Owner

@jvorcak This library is currently intended to provide the same API as the official rethinkdb javascript driver, identical except using a websocket instead of a TCP socket.

For something higher level that manages automatic reconnecting, something like react-rethinkdb can manage automatic reconnection. Or any other high level data layer library could sub rethinkdb-websocket-client in place of the rethinkdb driver.

Does that make sense, or is there a reason you think automatic reconnection should be implemented at this level?

@akatebi
Copy link

akatebi commented May 1, 2016

Web sockets normally timeout after 300 seconds to close idle connections. The reconnect option seems to be a natural solution. The reconnect should be lazy. In other word only when a query needs to run with a closed out connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants