コード例 #1
0
        public async Task <BizResult <bool> > DeleteZNode(string path)
        {
            if (!await _zookeeperClient.ExistsAsync(path))
            {
                return(new BizResult <bool>(false, -1, "删除的节点不存在!"));
            }

            await _zookeeperClient.DeleteAsync(path);

            return(new BizResult <bool>(true));
        }
コード例 #2
0
        public async Task <bool> TryDeleteEnvironmentAsync(string environment)
        {
            var path = pathHelper.BuildEnvironmentPath(environment);

            var deleteRequest = new DeleteRequest(path)
            {
                DeleteChildrenIfNeeded = true
            };

            var deleteResult = await zooKeeperClient.DeleteAsync(deleteRequest).ConfigureAwait(false);

            return(deleteResult.IsSuccessful);
        }
コード例 #3
0
        private async Task <bool> DeleteNodeAsync()
        {
            var deleteResult = await zooKeeperClient.DeleteAsync(replicaNodePath).ConfigureAwait(false);

            return(deleteResult.IsSuccessful);
        }
コード例 #4
0
        public async Task <BizResult <bool> > DeleteNode(string path)
        {
            await _zookeeperClient.DeleteAsync(path);

            return(new BizResult <bool>(true));
        }
 /// <inheritdoc cref="IZooKeeperClient.DeleteAsync"/>
 public static DeleteResult Delete(this IZooKeeperClient client, DeleteRequest request) =>
 client.DeleteAsync(request).GetAwaiter().GetResult();