-
Notifications
You must be signed in to change notification settings - Fork 542
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
how to Detect leader changed? #300
Comments
// RaftEventListener is the listener for Raft events, such as Raft leadership
// change, exposed to user space. NodeHost uses a single dedicated goroutine
// to invoke all RaftEventListener methods one by one, CPU intensive or IO
// related procedures that can cause long delays should be offloaded to worker
// goroutines managed by users. See the raftio.IRaftEventListener definition
// for more details.
RaftEventListener raftio.IRaftEventListener type IRaftEventListener interface {
LeaderUpdated(info LeaderInfo)
} type LeaderInfo struct {
ShardID uint64
ReplicaID uint64
Term uint64
LeaderID uint64
} |
|
your new question is being addressed in #301. |
I've got a use case where I have a scheduler. It only needs to be run on one node. However I'm using dragonboat to provide HA. What would be the best mechanism to only ensure the scheduler runs in 1 node only? Thanks |
How to check whether the leader has changed? How to register an observer and perform certain operations when the leader sends a change
The text was updated successfully, but these errors were encountered: