node-zkplus
node-zkplus copied to clipboard
Not able to catch onLeader and onnewLeader event
Hi,
I really like the zkplus . Thanks for such a nice abstraction . I am currently struck at a point. I am able to catch the close event but not able to catch the leader and newLeader event. Below is my code. Please help
election.vote(function (err, isLeader) { if(err) console.log(err); console.log(isLeader); // => 'true' || 'false' });
election.on('leader' , function(){ console.log("new leader--------------->>>>>>>>>>"); });
election.on('newLeader' , function(leader){ console.log("new leader" , leader); });
election.on('close', function () { console.log("new leader stopped--------------->>>>>>>>>>"); });
Folks any update on this. I'm also facing this issue.