lib/ServiceDiscovery.js
//2. Register the service and create an ephemeral node
2. Register the service and create an ephemeral node
2 . Register the service and create an ephemeral node
function registerService(path, callback) {
        var data = self.serviceInstance.getData();
        self.data = data;
        var servicePath = [path, data.host + ":" + data.port].join('/');
        self.client
            .getZkClient()
            .transaction()
            .create(servicePath, new Buffer(JSON.stringify(data)), null, CreateMode.EPHEMERAL)
            .commit(callback);
    }
function registerService ( path , callback ) { var data = self . serviceInstance . getData ( ) ; self . data = data ; var servicePath = [ path , data . host + ":" + data . port ] . join ( '/' ) ; self . client . getZkClient ( ) . transaction ( ) . create ( servicePath , new Buffer ( JSON . stringify ( data ) ) , null , CreateMode . EPHEMERAL ) . commit ( callback ) ; }
2.
2 .