private async Task <bool> VerifyDataAsync( [NotNull] QualityVerificationGrpc.QualityVerificationGrpcClient rpcClient, [NotNull] CancellationTokenSource cancellationSource, [CanBeNull] SchemaMsg schemaMsg = null) { using (var call = rpcClient.VerifyDataQuality()) { var initialRequest = new DataVerificationRequest { Request = VerificationRequest, Schema = schemaMsg }; await call.RequestStream.WriteAsync(initialRequest); while (await call.ResponseStream.MoveNext(cancellationSource.Token)) { var responseMsg = call.ResponseStream.Current; if (responseMsg.SchemaRequest != null || responseMsg.DataRequest != null) { await ProvideDataToServer(responseMsg, call.RequestStream, cancellationSource); } else { HandleProgressMsg(responseMsg.Response); } } } return(true); }
protected override void ChannelOpenedCore(Channel channel) { if (!ChannelIsLoadBalancer) { _staticQaClient = new QualityVerificationGrpc.QualityVerificationGrpcClient(channel); } }
public async Task <ServiceCallStatus> ExecuteAndProcessMessagesAsync( [NotNull] QualityVerificationGrpc.QualityVerificationGrpcClient rpcClient, bool provideDataFromClient = false, SchemaMsg schemaMsg = null) { return(provideDataFromClient ? await TryExecuteAsync(c => VerifyDataAsync(rpcClient, c, schemaMsg)) : await TryExecuteAsync(c => VerifyAsync(rpcClient, c))); }
public DistributedTestRunner( [NotNull] QualityVerificationGrpc.QualityVerificationGrpcClient qaClient, [NotNull] VerificationRequest originalRequest, [CanBeNull] ConcurrentBag <IssueMsg> issueCollection) { Assert.NotNull(qaClient, nameof(qaClient)); Assert.NotNull(originalRequest, nameof(originalRequest)); Assert.ArgumentCondition(originalRequest.MaxParallelProcessing > 1, "maxParallelDesired must be greater 1"); _qaClient = qaClient; _originalRequest = originalRequest; _issueCollection = issueCollection; }
private async Task <bool> VerifyAsync( [NotNull] QualityVerificationGrpc.QualityVerificationGrpcClient rpcClient, CancellationTokenSource cancellationSource) { using (var call = rpcClient.VerifyQuality(VerificationRequest)) { while (await call.ResponseStream.MoveNext(cancellationSource.Token)) { VerificationResponse responseMsg = call.ResponseStream.Current; HandleProgressMsg(responseMsg); } } return(true); }
public static WpfHostingWinForm CreateVerificationProgressForm( [NotNull] QualityVerificationGrpc.QualityVerificationGrpcClient qaClient, [NotNull] BackgroundVerificationRun verificationRun, [CanBeNull] string title) { async Task <ServiceCallStatus> VerificationAction() { return(await verificationRun.ExecuteAndProcessMessagesAsync(qaClient)); } var progressForm = CreateVerificationProgressForm( verificationRun.Progress, VerificationAction, verificationRun.ShowReportAction, verificationRun.SaveAction, title); progressForm.SetMinimumSize(275, 0); progressForm.SetMaximumSize(900, int.MaxValue); return(progressForm); }
/// <summary> /// Creates the verification progress form that will start the verification once /// it is shown. /// </summary> /// <param name="qaClient">The client endpoint</param> /// <param name="verificationRun">The verification run</param> /// <param name="openErrorWorklist">Optional command that should open the work list</param> /// <param name="zoomToPerimeter">Optional command that should zoom to the verified perimeter</param> /// <param name="flashTileProgressAction">The action to flash the current progress. The list of /// envelopes represents the processed tiles. The last entry is the currently processing tile.</param> /// <param name="title"></param> /// <returns></returns> public static WpfHostingWinForm CreateVerificationProgressForm( [NotNull] QualityVerificationGrpc.QualityVerificationGrpcClient qaClient, [NotNull] BackgroundVerificationRun verificationRun, [CanBeNull] ICommand openErrorWorklist, [CanBeNull] ICommand zoomToPerimeter, [CanBeNull] Action <IList <EnvelopeXY> > flashTileProgressAction, [CanBeNull] string title) { async Task <ServiceCallStatus> VerificationAction() { return(await verificationRun.ExecuteAndProcessMessagesAsync(qaClient)); } var progressForm = CreateVerificationProgressForm( verificationRun.Progress, VerificationAction, verificationRun.ShowReportAction, verificationRun.SaveAction, openErrorWorklist, zoomToPerimeter, flashTileProgressAction, title); progressForm.SetMinimumSize(275, 0); progressForm.SetMaximumSize(900, int.MaxValue); return(progressForm); }
protected override void ChannelOpenedCore(Channel channel) { QaClient = new QualityVerificationGrpc.QualityVerificationGrpcClient(channel); }