lib/uAlive.js
function uServicesManager(){

 client.publish('uServicesChannel', 'UPDATE');

 listenClient.on('message', function(channel, message) {

  client.get('uServices', function(err, reply) {
   if (reply !== null) {
    uServices = JSON.parse(reply);
   }
  });
 });

 listenClient.on("error", function (err) {
  console.log("Redis listen "+ err);
  listenClient.quit();
 });

 listenClient.subscribe('uServicesChannel');
}
function uServicesManager(){

 client.publish('uServicesChannel', 'UPDATE');

 listenClient.on('message', function(channel, message) {

  client.get('uServices', function(err, reply) {
   if (reply !== null) {
    uServices = JSON.parse(reply);
   }
  });
 });

 listenClient.on("error", function (err) {
  console.log("Redis listen "+ err);
  listenClient.quit();
 });

 listenClient.subscribe('uServicesChannel');
}
function uServicesManager ( ) { client . publish ( 'uServicesChannel' , 'UPDATE' ) ; listenClient . on ( 'message' , function ( channel , message ) { client . get ( 'uServices' , function ( err , reply ) { if ( reply !== null ) { uServices = JSON . parse ( reply ) ; } } ) ; } ) ; listenClient . on ( "error" , function ( err ) { console . log ( "Redis listen " + err ) ; listenClient . quit ( ) ; } ) ; listenClient . subscribe ( 'uServicesChannel' ) ; }
Worker Logic
I want this to listen always
Listen for UPDATE in the uServices object
Worker Logic I want this to listen always Listen for UPDATE in the uServices object