blob: 46b16cf202db82fd73f9df6ea455bcb0243dd55a [file] [log] [blame]
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -07001// Generated by the protocol buffer compiler. DO NOT EDIT!
Jan Tattermusch72ce4422016-01-20 13:54:38 -08002// source: src/proto/grpc/testing/services.proto
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -07003#region Designer generated code
4
5using System;
6using System.Threading;
7using System.Threading.Tasks;
8using Grpc.Core;
9
10namespace Grpc.Testing {
11 public static class BenchmarkService
12 {
13 static readonly string __ServiceName = "grpc.testing.BenchmarkService";
14
15 static readonly Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
16 static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
17
18 static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
19 MethodType.Unary,
20 __ServiceName,
21 "UnaryCall",
22 __Marshaller_SimpleRequest,
23 __Marshaller_SimpleResponse);
24
25 static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
26 MethodType.DuplexStreaming,
27 __ServiceName,
28 "StreamingCall",
29 __Marshaller_SimpleRequest,
30 __Marshaller_SimpleResponse);
31
32 // service descriptor
33 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
34 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -080035 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070036 }
37
38 // client interface
Jan Tattermuschddc4e342016-03-21 19:03:14 -070039 [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070040 public interface IBenchmarkServiceClient
41 {
42 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
43 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options);
44 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
45 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options);
46 AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
47 AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options);
48 }
49
50 // server-side interface
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070051 [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070052 public interface IBenchmarkService
53 {
54 Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context);
55 Task StreamingCall(IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, ServerCallContext context);
56 }
57
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070058 // server-side abstract class
59 public abstract class BenchmarkServiceBase
60 {
61 public virtual Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context)
62 {
63 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
64 }
65
66 public virtual Task StreamingCall(IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, ServerCallContext context)
67 {
68 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
69 }
70
71 }
72
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070073 // client stub
Jan Tattermuschddc4e342016-03-21 19:03:14 -070074 public class BenchmarkServiceClient : ClientBase<BenchmarkServiceClient>, IBenchmarkServiceClient
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070075 {
76 public BenchmarkServiceClient(Channel channel) : base(channel)
77 {
78 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -070079 public BenchmarkServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070080 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070081 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -070082 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
83 protected BenchmarkServiceClient() : base()
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070084 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070085 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -070086 ///<summary>Protected constructor to allow creation of configured clients.</summary>
87 protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070088 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070089 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -070090
91 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070092 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -070093 return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070094 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -070095 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070096 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -070097 return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070098 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -070099 public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700100 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700101 return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
102 }
103 public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options)
104 {
105 return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request);
106 }
107 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
108 {
109 return StreamingCall(new CallOptions(headers, deadline, cancellationToken));
110 }
111 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options)
112 {
113 return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options);
114 }
115 protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration)
116 {
117 return new BenchmarkServiceClient(configuration);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700118 }
119 }
120
121 // creates service definition that can be registered with a server
122 public static ServerServiceDefinition BindService(IBenchmarkService serviceImpl)
123 {
124 return ServerServiceDefinition.CreateBuilder(__ServiceName)
125 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
126 .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build();
127 }
128
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700129 // creates service definition that can be registered with a server
130 public static ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl)
131 {
132 return ServerServiceDefinition.CreateBuilder(__ServiceName)
133 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
134 .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build();
135 }
136
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700137 // creates a new client
138 public static BenchmarkServiceClient NewClient(Channel channel)
139 {
140 return new BenchmarkServiceClient(channel);
141 }
142
143 }
144 public static class WorkerService
145 {
146 static readonly string __ServiceName = "grpc.testing.WorkerService";
147
148 static readonly Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_ServerArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom);
149 static readonly Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_ServerStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom);
150 static readonly Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_ClientArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom);
151 static readonly Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_ClientStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800152 static readonly Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_CoreRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom);
153 static readonly Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_CoreResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom);
154 static readonly Marshaller<global::Grpc.Testing.Void> __Marshaller_Void = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700155
156 static readonly Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> __Method_RunServer = new Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>(
157 MethodType.DuplexStreaming,
158 __ServiceName,
159 "RunServer",
160 __Marshaller_ServerArgs,
161 __Marshaller_ServerStatus);
162
163 static readonly Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> __Method_RunClient = new Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>(
164 MethodType.DuplexStreaming,
165 __ServiceName,
166 "RunClient",
167 __Marshaller_ClientArgs,
168 __Marshaller_ClientStatus);
169
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800170 static readonly Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse> __Method_CoreCount = new Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>(
171 MethodType.Unary,
172 __ServiceName,
173 "CoreCount",
174 __Marshaller_CoreRequest,
175 __Marshaller_CoreResponse);
176
177 static readonly Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void> __Method_QuitWorker = new Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void>(
178 MethodType.Unary,
179 __ServiceName,
180 "QuitWorker",
181 __Marshaller_Void,
182 __Marshaller_Void);
183
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700184 // service descriptor
185 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
186 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -0800187 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700188 }
189
190 // client interface
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700191 [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")]
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700192 public interface IWorkerServiceClient
193 {
194 AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
195 AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options);
196 AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
197 AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800198 global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
199 global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options);
200 AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
201 AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options);
202 global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
203 global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options);
204 AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
205 AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700206 }
207
208 // server-side interface
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700209 [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")]
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700210 public interface IWorkerService
211 {
212 Task RunServer(IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, ServerCallContext context);
213 Task RunClient(IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, ServerCallContext context);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800214 Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context);
215 Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700216 }
217
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700218 // server-side abstract class
219 public abstract class WorkerServiceBase
220 {
221 public virtual Task RunServer(IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, ServerCallContext context)
222 {
223 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
224 }
225
226 public virtual Task RunClient(IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, ServerCallContext context)
227 {
228 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
229 }
230
231 public virtual Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context)
232 {
233 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
234 }
235
236 public virtual Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context)
237 {
238 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
239 }
240
241 }
242
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700243 // client stub
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700244 public class WorkerServiceClient : ClientBase<WorkerServiceClient>, IWorkerServiceClient
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700245 {
246 public WorkerServiceClient(Channel channel) : base(channel)
247 {
248 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700249 public WorkerServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700250 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700251 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700252 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
253 protected WorkerServiceClient() : base()
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700254 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700255 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700256 ///<summary>Protected constructor to allow creation of configured clients.</summary>
257 protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700258 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700259 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700260
261 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700262 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700263 return RunServer(new CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700264 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700265 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800266 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700267 return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800268 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700269 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800270 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700271 return RunClient(new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800272 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700273 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800274 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700275 return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800276 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700277 public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800278 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700279 return CoreCount(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800280 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700281 public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800282 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700283 return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800284 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700285 public virtual AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800286 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700287 return CoreCountAsync(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800288 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700289 public virtual AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800290 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700291 return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800292 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700293 public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800294 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700295 return QuitWorker(request, new CallOptions(headers, deadline, cancellationToken));
296 }
297 public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options)
298 {
299 return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request);
300 }
301 public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
302 {
303 return QuitWorkerAsync(request, new CallOptions(headers, deadline, cancellationToken));
304 }
305 public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options)
306 {
307 return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request);
308 }
309 protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration)
310 {
311 return new WorkerServiceClient(configuration);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800312 }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700313 }
314
315 // creates service definition that can be registered with a server
316 public static ServerServiceDefinition BindService(IWorkerService serviceImpl)
317 {
318 return ServerServiceDefinition.CreateBuilder(__ServiceName)
319 .AddMethod(__Method_RunServer, serviceImpl.RunServer)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800320 .AddMethod(__Method_RunClient, serviceImpl.RunClient)
321 .AddMethod(__Method_CoreCount, serviceImpl.CoreCount)
322 .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build();
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700323 }
324
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700325 // creates service definition that can be registered with a server
326 public static ServerServiceDefinition BindService(WorkerServiceBase serviceImpl)
327 {
328 return ServerServiceDefinition.CreateBuilder(__ServiceName)
329 .AddMethod(__Method_RunServer, serviceImpl.RunServer)
330 .AddMethod(__Method_RunClient, serviceImpl.RunClient)
331 .AddMethod(__Method_CoreCount, serviceImpl.CoreCount)
332 .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build();
333 }
334
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700335 // creates a new client
336 public static WorkerServiceClient NewClient(Channel channel)
337 {
338 return new WorkerServiceClient(channel);
339 }
340
341 }
342}
343#endregion