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)); }
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); }
private async Task <bool> DeleteNodeAsync() { var deleteResult = await zooKeeperClient.DeleteAsync(replicaNodePath).ConfigureAwait(false); return(deleteResult.IsSuccessful); }
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();