示例#1
0
                public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
                {
                    iprot.IncrementRecursionDepth();
                    try
                    {
                        TField field;
                        await iprot.ReadStructBeginAsync(cancellationToken);

                        while (true)
                        {
                            field = await iprot.ReadFieldBeginAsync(cancellationToken);

                            if (field.Type == TType.Stop)
                            {
                                break;
                            }

                            switch (field.ID)
                            {
                            case 1:
                                if (field.Type == TType.Struct)
                                {
                                    Request = new global::Jaeger.Thrift.Crossdock.JoinTraceRequest();
                                    await Request.ReadAsync(iprot, cancellationToken);
                                }
                                else
                                {
                                    await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                                }
                                break;

                            default:
                                await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                                break;
                            }

                            await iprot.ReadFieldEndAsync(cancellationToken);
                        }

                        await iprot.ReadStructEndAsync(cancellationToken);
                    }
                    finally
                    {
                        iprot.DecrementRecursionDepth();
                    }
                }
示例#2
0
            public async global::System.Threading.Tasks.Task <global::Jaeger.Thrift.Crossdock.TraceResponse> joinTraceAsync(global::Jaeger.Thrift.Crossdock.JoinTraceRequest request, CancellationToken cancellationToken = default)
            {
                await OutputProtocol.WriteMessageBeginAsync(new TMessage("joinTrace", TMessageType.Call, SeqId), cancellationToken);

                var args = new InternalStructs.joinTraceArgs()
                {
                    Request = request,
                };

                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 InternalStructs.joinTraceResult();
                await result.ReadAsync(InputProtocol, cancellationToken);

                await InputProtocol.ReadMessageEndAsync(cancellationToken);

                if (result.__isset.success)
                {
                    return(result.Success);
                }
                throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "joinTrace failed: unknown result");
            }