public string GetConfig(string path, bool local = true) { if (local) { return(ZkCache.GetValue(path)); } else { return(Watch(path)); } }
public string Watch(string path) { var stat = Zookeeper.Exists(path, new ConfigCenterWatcher(Zookeeper, ZkCache)); if (stat != null) { var data = Zookeeper.GetData(path, false, null).GetString(); ZkCache.SetValue(path, data); return(data); } return(null); }