// 读取节点的配置数据
        public async Task <string> ReadConfigDataAsync()
        {
            if (this.ZK == null)
            {
                return(string.Empty);
            }

            var stat = await ZK.existsAsync(QueryPath, true);

            if (stat == null)
            {
                return(string.Empty);
            }

            this.Stat = stat;

            var dataResult = await ZK.getDataAsync(QueryPath, true);

            return(Encoding.UTF8.GetString(dataResult.Data));
        }
Ejemplo n.º 2
0
        public async Task <bool> ExistsAsync(string path, bool watch = false)
        {
            var state = await ZK.existsAsync(path, watch : watch);

            return(state != null);
        }