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

Force reconnect #48

Open
Zinggi opened this issue May 11, 2018 · 0 comments
Open

Force reconnect #48

Zinggi opened this issue May 11, 2018 · 0 comments

Comments

@Zinggi
Copy link

Zinggi commented May 11, 2018

First off, huge thanks for creating this great library, it has a very nice API and just works!
Now to my issue:


Is it possible to force trying to reconnect immediately once the connection to a websocket was lost, e.g. a function like:
tryReconnect : Socket -> List (Channel msg) -> Cmd msg


My use case is the following:
I have an application that uses chanels to exchange messages 'directly' between multiple devices of a user. (e.g. PC to phone)
For some of these messages, it is important that they are delivered as quickly as possible.

This is no problem when both devices have the website open.
However, if the phone is locked, it loses the connection. If I then want to send a message from my PC to the phone, I expect that the phone will receive the message as soon as I unlock it.
However, since there doesn't seem to be a way to immediately connect to the socket, a user now has to wait up to 30 seconds before the message is delivered.

With a function that would try to reconnect immediately, I could solve this easily by calling it every time the user unlocks the phone.

I hope that made sense.

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

1 participant