Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Side by Side Diff: third_party/grpc/src/csharp/Grpc.Examples/MathGrpc.cs

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: math.proto
3 #region Designer generated code
4
5 using System;
6 using System.Threading;
7 using System.Threading.Tasks;
8 using Grpc.Core;
9
10 namespace Math {
11 public static class Math
12 {
13 static readonly string __ServiceName = "math.Math";
14
15 static readonly Marshaller<global::Math.DivArgs> __Marshaller_DivArgs = Mars hallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(ar g), global::Math.DivArgs.Parser.ParseFrom);
16 static readonly Marshaller<global::Math.DivReply> __Marshaller_DivReply = Ma rshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray( arg), global::Math.DivReply.Parser.ParseFrom);
17 static readonly Marshaller<global::Math.FibArgs> __Marshaller_FibArgs = Mars hallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(ar g), global::Math.FibArgs.Parser.ParseFrom);
18 static readonly Marshaller<global::Math.Num> __Marshaller_Num = Marshallers. Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), glob al::Math.Num.Parser.ParseFrom);
19
20 static readonly Method<global::Math.DivArgs, global::Math.DivReply> __Method _Div = new Method<global::Math.DivArgs, global::Math.DivReply>(
21 MethodType.Unary,
22 __ServiceName,
23 "Div",
24 __Marshaller_DivArgs,
25 __Marshaller_DivReply);
26
27 static readonly Method<global::Math.DivArgs, global::Math.DivReply> __Method _DivMany = new Method<global::Math.DivArgs, global::Math.DivReply>(
28 MethodType.DuplexStreaming,
29 __ServiceName,
30 "DivMany",
31 __Marshaller_DivArgs,
32 __Marshaller_DivReply);
33
34 static readonly Method<global::Math.FibArgs, global::Math.Num> __Method_Fib = new Method<global::Math.FibArgs, global::Math.Num>(
35 MethodType.ServerStreaming,
36 __ServiceName,
37 "Fib",
38 __Marshaller_FibArgs,
39 __Marshaller_Num);
40
41 static readonly Method<global::Math.Num, global::Math.Num> __Method_Sum = ne w Method<global::Math.Num, global::Math.Num>(
42 MethodType.ClientStreaming,
43 __ServiceName,
44 "Sum",
45 __Marshaller_Num,
46 __Marshaller_Num);
47
48 // service descriptor
49 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descripto r
50 {
51 get { return global::Math.MathReflection.Descriptor.Services[0]; }
52 }
53
54 // client interface
55 public interface IMathClient
56 {
57 global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default( CancellationToken));
58 global::Math.DivReply Div(global::Math.DivArgs request, CallOptions option s);
59 AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs reques t, Metadata headers = null, DateTime? deadline = null, CancellationToken cancell ationToken = default(CancellationToken));
60 AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs reques t, CallOptions options);
61 AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivM any(Metadata headers = null, DateTime? deadline = null, CancellationToken cancel lationToken = default(CancellationToken));
62 AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivM any(CallOptions options);
63 AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs reques t, Metadata headers = null, DateTime? deadline = null, CancellationToken cancell ationToken = default(CancellationToken));
64 AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs reques t, CallOptions options);
65 AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
66 AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(CallOptio ns options);
67 }
68
69 // server-side interface
70 public interface IMath
71 {
72 Task<global::Math.DivReply> Div(global::Math.DivArgs request, ServerCallCo ntext context);
73 Task DivMany(IAsyncStreamReader<global::Math.DivArgs> requestStream, IServ erStreamWriter<global::Math.DivReply> responseStream, ServerCallContext context) ;
74 Task Fib(global::Math.FibArgs request, IServerStreamWriter<global::Math.Nu m> responseStream, ServerCallContext context);
75 Task<global::Math.Num> Sum(IAsyncStreamReader<global::Math.Num> requestStr eam, ServerCallContext context);
76 }
77
78 // client stub
79 public class MathClient : ClientBase, IMathClient
80 {
81 public MathClient(Channel channel) : base(channel)
82 {
83 }
84 public global::Math.DivReply Div(global::Math.DivArgs request, Metadata he aders = null, DateTime? deadline = null, CancellationToken cancellationToken = d efault(CancellationToken))
85 {
86 var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, c ancellationToken));
87 return Calls.BlockingUnaryCall(call, request);
88 }
89 public global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options)
90 {
91 var call = CreateCall(__Method_Div, options);
92 return Calls.BlockingUnaryCall(call, request);
93 }
94 public AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
95 {
96 var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, c ancellationToken));
97 return Calls.AsyncUnaryCall(call, request);
98 }
99 public AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, CallOptions options)
100 {
101 var call = CreateCall(__Method_Div, options);
102 return Calls.AsyncUnaryCall(call, request);
103 }
104 public AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivRepl y> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
105 {
106 var call = CreateCall(__Method_DivMany, new CallOptions(headers, deadlin e, cancellationToken));
107 return Calls.AsyncDuplexStreamingCall(call);
108 }
109 public AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivRepl y> DivMany(CallOptions options)
110 {
111 var call = CreateCall(__Method_DivMany, options);
112 return Calls.AsyncDuplexStreamingCall(call);
113 }
114 public AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
115 {
116 var call = CreateCall(__Method_Fib, new CallOptions(headers, deadline, c ancellationToken));
117 return Calls.AsyncServerStreamingCall(call, request);
118 }
119 public AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, CallOptions options)
120 {
121 var call = CreateCall(__Method_Fib, options);
122 return Calls.AsyncServerStreamingCall(call, request);
123 }
124 public AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Me tadata headers = null, DateTime? deadline = null, CancellationToken cancellation Token = default(CancellationToken))
125 {
126 var call = CreateCall(__Method_Sum, new CallOptions(headers, deadline, c ancellationToken));
127 return Calls.AsyncClientStreamingCall(call);
128 }
129 public AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Ca llOptions options)
130 {
131 var call = CreateCall(__Method_Sum, options);
132 return Calls.AsyncClientStreamingCall(call);
133 }
134 }
135
136 // creates service definition that can be registered with a server
137 public static ServerServiceDefinition BindService(IMath serviceImpl)
138 {
139 return ServerServiceDefinition.CreateBuilder(__ServiceName)
140 .AddMethod(__Method_Div, serviceImpl.Div)
141 .AddMethod(__Method_DivMany, serviceImpl.DivMany)
142 .AddMethod(__Method_Fib, serviceImpl.Fib)
143 .AddMethod(__Method_Sum, serviceImpl.Sum).Build();
144 }
145
146 // creates a new client
147 public static MathClient NewClient(Channel channel)
148 {
149 return new MathClient(channel);
150 }
151
152 }
153 }
154 #endregion
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698