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

Example for reconnecting to nodes if they drop out #284

Open
pocockn opened this issue May 26, 2020 · 1 comment
Open

Example for reconnecting to nodes if they drop out #284

pocockn opened this issue May 26, 2020 · 1 comment

Comments

@pocockn
Copy link

pocockn commented May 26, 2020

I'm creating an application that has a node that broadcasts messages out to all the nodes that are connected to it. I'm currently using a simple approach where I get my child nodes to ping the master node so they get added to the route table and then my master node can send messages to all the connected nodes.

I'm thinking it would be nice to have an example to show how to handle the situation when my master node drops out and then the child nodes do some sort of retry until the master node comes back online.

I wanted to have a loop running and a select that listened on the client method WaitUntilReady that tells my child nodes the client connection has closed and then tries to reconnect every x seconds but I don't think WaitUntilReady returns a channel.

I'm not sure if my use case can be easily done with the current implementation, great library though.

@johnhorsema
Copy link

Check out lithew/monte. It's by the same author and has reconnection functionality.

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