socket-master

Node module to negociate master/slave roles to nodes process

npm install socket-master
8 downloads in the last week
32 downloads in the last month

SocketMaster

Node module to negociate master/slave roles to nodes process

Install

sudo npm install socket-master

Use

var trigger = require('socket-master');

trigger.on('master', function(socket) { 
  console.log("I'm your master"); // Function called when this instance become the master
});

trigger.on('unmaster', function(socket) { 
  console.log("I'm not your master"); // Function called when this instance is no longer the master
});

trigger.on('slave', function(socket) { 
  console.log("I'm your slave"); // Function called when this instance become the slave
});

trigger.on('unslave', function(socket) { 
  console.log("I'm not your slave"); // Function called when this instance is no longer the slace
});

trigger.connect(); //Connection request send
npm loves you