private async Task <T> ProcessAsync <T>(IOrientDBOperation <T> operation, OrientDBNetworkConnection stream) { try { var request = operation.CreateRequest(stream.SessionId, stream.Token); var reader = await SendAsync(request, stream.GetStream()); return(operation.Execute(reader)); } catch { Destroy(stream); throw; } }
private T Process <T>(IOrientDBOperation <T> operation, OrientDBNetworkConnection stream) { try { Request request = operation.CreateRequest(stream.SessionId, stream.Token); var reader = Send(request, stream.GetStream()); T result = operation.Execute(reader); return(result); } catch { Destroy(stream); throw; } }