Skip to content
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

Handle disconnections gracefully #29

Open
sdwilsh opened this issue Oct 3, 2020 · 2 comments
Open

Handle disconnections gracefully #29

sdwilsh opened this issue Oct 3, 2020 · 2 comments

Comments

@sdwilsh
Copy link
Owner

sdwilsh commented Oct 3, 2020

Looks like we need to build some code to handle disconnections from the server and automatically reconnect. python-websockets/websockets#414 has some sample code.

@filwaline
Copy link

An attempt with async-generator
https://gist.github.com/filwaline/37309797265079f2ad7fcc47999575b2

@sdwilsh
Copy link
Owner Author

sdwilsh commented Jan 5, 2021

I put some work into how to do this yesterday, and it's hard to do it at our library level, I think. We can make it easier for clients to detect if the connect was closed, however, and re-initialize it.

sdwilsh added a commit that referenced this issue Jan 5, 2021
This is a workaround for clients to deal with #29.  We do not have an
easy way to automatically re-estabilish the connection (at least today),
so this allows a client to check if it is closed, and restart the
connection itself.
sdwilsh added a commit that referenced this issue Jan 5, 2021
This is a workaround for clients to deal with #29.  We do not have an
easy way to automatically re-estabilish the connection (at least today),
so this allows a client to check if it is closed, and restart the
connection itself.
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

2 participants