lib/ServiceDiscovery.js
//3. If a callback is bound, relay the error/response via the callback and listen for 'healthCheckChange' event
3. If a callback is bound, relay the error/response via the callback and listen for 'healthCheckChange' event
3 . If a callback is bound relay the error / response via the callback and listen for ' healthCheckChange ' event
function completed(err, res) {
        if (err) {
            return callback(err);
        }
        self.healthCheckEvent(self);
        setInterval(function () {
            self.updateServiceInstanceData(function (error) {
                if (error)
                    logger.error("error while updating instance data in zookeeper: ", error);
            })
        }, self.refreshInterval);
        logger.info("Registered service on zookeeper:", JSON.stringify(self.data));
        callback(err, res);
    }
function completed ( err , res ) { if ( err ) { return callback ( err ) ; } self . healthCheckEvent ( self ) ; setInterval ( function ( ) { self . updateServiceInstanceData ( function ( error ) { if ( error ) logger . error ( "error while updating instance data in zookeeper: " , error ) ; } ) } , self . refreshInterval ) ; logger . info ( "Registered service on zookeeper:" , JSON . stringify ( self . data ) ) ; callback ( err , res ) ; }
3.
3 .
/* Event to update service instance data in Zookeeper, checks healthcheck and updates to latest timestamp */