//public IEnumerable<TagIntegrationEvent> NotifyTagInvoke(Dto.Common.NotifyTagReq request, CancellationToken cancellationToken = default) //{ // //CallOptions = CallOptions.WithCancellationToken(cancellationToken); // CallOptions = CallOptions.WithCancellationToken(cancellationToken); // CallContext = new CallContext(CallOptions, CallContextFlags.IgnoreStreamTermination); // using (Channel) // { // ITransaction client = Channel.CreateGrpcService<ITransaction>(); // return client.NotifyTagInvoke(request, CallContext); // } //} public IAsyncEnumerable <Dto.Biz.NotifyTagRes> NotifyTagInvokeAsync(Dto.Biz.NotifyTagReq request, CancellationToken cancellationToken = default) { //CallOptions = CallOptions.WithCancellationToken(cancellationToken); CallOptions = CallOptions.WithCancellationToken(cancellationToken); CallContext = new CallContext(CallOptions, CallContextFlags.IgnoreStreamTermination); using (Channel) { IBizAsync client = Channel.CreateGrpcService <IBizAsync>(); return(client.NotifyTagInvokeAsync(request, CallContext)); } }
public IAsyncEnumerable <Dto.HeartBeat> SendHeartBeatAsync(CancellationToken cancellationToken = default) { //CallOptions = CallOptions.WithCancellationToken(cancellationToken); CallOptions = CallOptions.WithCancellationToken(cancellationToken); CallContext = new CallContext(CallOptions, CallContextFlags.IgnoreStreamTermination); using (Channel) { IBizAsync client = Channel.CreateGrpcService <IBizAsync>(); return(client.SendHeartBeatAsync(CallContext)); } }
public async ValueTask <WriteLog> WriteLogsAsync(App.Dto.Req.Biz.List.WriteLog request, CancellationToken cancellationToken = default) { CallOptions = CallOptions.WithCancellationToken(cancellationToken); CallContext = new CallContext(CallOptions, CallContextFlags.IgnoreStreamTermination); try { using (Channel) { IBizAsync client = Channel.CreateGrpcService <IBizAsync>(); return(await client.WriteLogsAsync(request, CallContext)); } } catch (Exception ex) { Logger.LogError(GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name + " - " + ex.Source + " " + ex.Message + " " + ex.StackTrace); } return(await new ValueTask <WriteLog>()); }
public async ValueTask <App.Dto.Res.Biz.GetTagValue> GetTagValueAsync(GetTagValue request, CancellationToken cancellationToken = default) { CallOptions = CallOptions.WithCancellationToken(cancellationToken); CallContext = new CallContext(CallOptions, CallContextFlags.IgnoreStreamTermination); App.Dto.Res.Biz.GetTagValue output = new App.Dto.Res.Biz.GetTagValue(); try { using (Channel) { IBizAsync client = Channel.CreateGrpcService <IBizAsync>(); var result = await client.GetTagValueAsync(request, CallContext); output = result; } } catch (Exception ex) { Logger.LogError(GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name + " - " + ex.Source + " " + ex.Message + " " + ex.StackTrace); } return(output); }