public async Task getSamplingStrategy_ProcessAsync(int seqid, TProtocol iprot, TProtocol oprot, CancellationToken cancellationToken) { var args = new getSamplingStrategyArgs(); await args.ReadAsync(iprot, cancellationToken); await iprot.ReadMessageEndAsync(cancellationToken); var result = new getSamplingStrategyResult(); try { result.Success = await _iAsync.getSamplingStrategyAsync(args.ServiceName, cancellationToken); await oprot.WriteMessageBeginAsync(new TMessage("getSamplingStrategy", TMessageType.Reply, seqid), cancellationToken); await result.WriteAsync(oprot, cancellationToken); } catch (TTransportException) { throw; } catch (Exception ex) { Console.Error.WriteLine("Error occurred in processor:"); Console.Error.WriteLine(ex.ToString()); var x = new TApplicationException(TApplicationException.ExceptionType.InternalError, " Internal error."); await oprot.WriteMessageBeginAsync(new TMessage("getSamplingStrategy", TMessageType.Exception, seqid), cancellationToken); await x.WriteAsync(oprot, cancellationToken); } await oprot.WriteMessageEndAsync(cancellationToken); await oprot.Transport.FlushAsync(cancellationToken); }
public getSamplingStrategyResult DeepCopy() { var tmp16 = new getSamplingStrategyResult(); if ((Success != null) && __isset.success) { tmp16.Success = (global::Jaeger.Thrift.Agent.SamplingStrategyResponse) this.Success.DeepCopy(); } tmp16.__isset.success = this.__isset.success; return(tmp16); }
public async Task <SamplingStrategyResponse> getSamplingStrategyAsync(string serviceName, CancellationToken cancellationToken) { await OutputProtocol.WriteMessageBeginAsync(new TMessage("getSamplingStrategy", TMessageType.Call, SeqId), cancellationToken); var args = new getSamplingStrategyArgs(); args.ServiceName = serviceName; await args.WriteAsync(OutputProtocol, cancellationToken); await OutputProtocol.WriteMessageEndAsync(cancellationToken); await OutputProtocol.Transport.FlushAsync(cancellationToken); var msg = await InputProtocol.ReadMessageBeginAsync(cancellationToken); if (msg.Type == TMessageType.Exception) { var x = await TApplicationException.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); throw x; } var result = new getSamplingStrategyResult(); await result.ReadAsync(InputProtocol, cancellationToken); await InputProtocol.ReadMessageEndAsync(cancellationToken); if (result.__isset.success) { return(result.Success); } throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getSamplingStrategy failed: unknown result"); }