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

Emit follower event on first join #6

Open
connor4312 opened this issue Mar 11, 2015 · 2 comments
Open

Emit follower event on first join #6

connor4312 opened this issue Mar 11, 2015 · 2 comments
Labels

Comments

@connor4312
Copy link
Contributor

When a raft first joins the cluster as a follower, and event does not appear to be emitted. This is my ugly fix for that...

    raft.on('follower',      function () { self.emit('follower'); });
    raft.on('leader change', function () {
        if (!self._emittedFollower) {
            self.emit('follower');
            self._emittedFollower = true;
        }
    });
@3rd-Eden
Copy link
Member

Hmm, yea, that needs fixing. Making as a bug.

@3rd-Eden 3rd-Eden added the bug label Mar 11, 2015
@connor4312
Copy link
Contributor Author

Perhaps a better way would be to have a "DISCONNECTED" state to represent a raft that's not joined a cluster yet, or has dropped out of the cluster (e.g. a local network failure). That would add some additional useful info and, as a side effect, emit the first follower event.

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

No branches or pull requests

2 participants