Skip to content

Not able to catch onLeader and onnewLeader event #26

@sakhil

Description

@sakhil

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--------------->>>>>>>>>>");
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions