blob: 9c99296115ce4a7f40f8c5479f053e17e19fcd56 [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 Tattermuschbfee01d2016-04-28 10:52:41 -07003// Original file comments:
4// Copyright 2015, Google Inc.
5// All rights reserved.
6//
7// Redistribution and use in source and binary forms, with or without
8// modification, are permitted provided that the following conditions are
9// met:
10//
11// * Redistributions of source code must retain the above copyright
12// notice, this list of conditions and the following disclaimer.
13// * Redistributions in binary form must reproduce the above
14// copyright notice, this list of conditions and the following disclaimer
15// in the documentation and/or other materials provided with the
16// distribution.
17// * Neither the name of Google Inc. nor the names of its
18// contributors may be used to endorse or promote products derived from
19// this software without specific prior written permission.
20//
21// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32//
33// An integration test service that covers all the method signature permutations
34// of unary/streaming requests/responses.
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070035#region Designer generated code
36
37using System;
38using System.Threading;
39using System.Threading.Tasks;
40using Grpc.Core;
41
42namespace Grpc.Testing {
43 public static class BenchmarkService
44 {
45 static readonly string __ServiceName = "grpc.testing.BenchmarkService";
46
47 static readonly Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
48 static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
49
50 static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
51 MethodType.Unary,
52 __ServiceName,
53 "UnaryCall",
54 __Marshaller_SimpleRequest,
55 __Marshaller_SimpleResponse);
56
57 static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
58 MethodType.DuplexStreaming,
59 __ServiceName,
60 "StreamingCall",
61 __Marshaller_SimpleRequest,
62 __Marshaller_SimpleResponse);
63
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070064 /// <summary>Service descriptor</summary>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070065 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
66 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -080067 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070068 }
69
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070070 /// <summary>Base class for server-side implementations of BenchmarkService</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070071 public abstract class BenchmarkServiceBase
72 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070073 /// <summary>
74 /// One request followed by one response.
75 /// The server returns the client payload as-is.
76 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -070077 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070078 {
79 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
80 }
81
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070082 /// <summary>
83 /// One request followed by one response.
84 /// The server returns the client payload as-is.
85 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -070086 public virtual global::System.Threading.Tasks.Task StreamingCall(IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070087 {
88 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
89 }
90
91 }
92
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070093 /// <summary>Client for BenchmarkService</summary>
Jan Tattermuschfcc8d972016-06-06 09:44:02 -070094 public class BenchmarkServiceClient : ClientBase<BenchmarkServiceClient>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070095 {
96 public BenchmarkServiceClient(Channel channel) : base(channel)
97 {
98 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -070099 public BenchmarkServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700100 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700101 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700102 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
103 protected BenchmarkServiceClient() : base()
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700104 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700105 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700106 ///<summary>Protected constructor to allow creation of configured clients.</summary>
107 protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700108 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700109 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700110
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700111 /// <summary>
112 /// One request followed by one response.
113 /// The server returns the client payload as-is.
114 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700115 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 -0700116 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700117 return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700118 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700119 /// <summary>
120 /// One request followed by one response.
121 /// The server returns the client payload as-is.
122 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700123 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700124 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700125 return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700126 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700127 /// <summary>
128 /// One request followed by one response.
129 /// The server returns the client payload as-is.
130 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700131 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 -0700132 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700133 return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
134 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700135 /// <summary>
136 /// One request followed by one response.
137 /// The server returns the client payload as-is.
138 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700139 public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options)
140 {
141 return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request);
142 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700143 /// <summary>
144 /// One request followed by one response.
145 /// The server returns the client payload as-is.
146 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700147 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
148 {
149 return StreamingCall(new CallOptions(headers, deadline, cancellationToken));
150 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700151 /// <summary>
152 /// One request followed by one response.
153 /// The server returns the client payload as-is.
154 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700155 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options)
156 {
157 return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options);
158 }
159 protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration)
160 {
161 return new BenchmarkServiceClient(configuration);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700162 }
163 }
164
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700165 /// <summary>Creates a new client for BenchmarkService</summary>
Jan Tattermusch7c0e1ee2016-04-25 16:00:34 -0700166 public static BenchmarkServiceClient NewClient(Channel channel)
167 {
168 return new BenchmarkServiceClient(channel);
169 }
170
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700171 /// <summary>Creates service definition that can be registered with a server</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700172 public static ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl)
173 {
Jan Tattermusch562cd052016-06-06 08:47:17 -0700174 return ServerServiceDefinition.CreateBuilder()
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700175 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
176 .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build();
177 }
178
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700179 }
180 public static class WorkerService
181 {
182 static readonly string __ServiceName = "grpc.testing.WorkerService";
183
184 static readonly Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_ServerArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom);
185 static readonly Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_ServerStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom);
186 static readonly Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_ClientArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom);
187 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 -0800188 static readonly Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_CoreRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom);
189 static readonly Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_CoreResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom);
190 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 -0700191
192 static readonly Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> __Method_RunServer = new Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>(
193 MethodType.DuplexStreaming,
194 __ServiceName,
195 "RunServer",
196 __Marshaller_ServerArgs,
197 __Marshaller_ServerStatus);
198
199 static readonly Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> __Method_RunClient = new Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>(
200 MethodType.DuplexStreaming,
201 __ServiceName,
202 "RunClient",
203 __Marshaller_ClientArgs,
204 __Marshaller_ClientStatus);
205
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800206 static readonly Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse> __Method_CoreCount = new Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>(
207 MethodType.Unary,
208 __ServiceName,
209 "CoreCount",
210 __Marshaller_CoreRequest,
211 __Marshaller_CoreResponse);
212
213 static readonly Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void> __Method_QuitWorker = new Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void>(
214 MethodType.Unary,
215 __ServiceName,
216 "QuitWorker",
217 __Marshaller_Void,
218 __Marshaller_Void);
219
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700220 /// <summary>Service descriptor</summary>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700221 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
222 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -0800223 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700224 }
225
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700226 /// <summary>Base class for server-side implementations of WorkerService</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700227 public abstract class WorkerServiceBase
228 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700229 /// <summary>
230 /// Start server with specified workload.
231 /// First request sent specifies the ServerConfig followed by ServerStatus
232 /// response. After that, a "Mark" can be sent anytime to request the latest
233 /// stats. Closing the stream will initiate shutdown of the test server
234 /// and once the shutdown has finished, the OK status is sent to terminate
235 /// this RPC.
236 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700237 public virtual global::System.Threading.Tasks.Task RunServer(IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700238 {
239 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
240 }
241
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700242 /// <summary>
243 /// Start client with specified workload.
244 /// First request sent specifies the ClientConfig followed by ClientStatus
245 /// response. After that, a "Mark" can be sent anytime to request the latest
246 /// stats. Closing the stream will initiate shutdown of the test client
247 /// and once the shutdown has finished, the OK status is sent to terminate
248 /// this RPC.
249 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700250 public virtual global::System.Threading.Tasks.Task RunClient(IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700251 {
252 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
253 }
254
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700255 /// <summary>
256 /// Just return the core count - unary call
257 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700258 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700259 {
260 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
261 }
262
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700263 /// <summary>
264 /// Quit this worker
265 /// </summary>
Jan Tattermuschd83f7912016-05-09 10:28:10 -0700266 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700267 {
268 throw new RpcException(new Status(StatusCode.Unimplemented, ""));
269 }
270
271 }
272
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700273 /// <summary>Client for WorkerService</summary>
Jan Tattermuschfcc8d972016-06-06 09:44:02 -0700274 public class WorkerServiceClient : ClientBase<WorkerServiceClient>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700275 {
276 public WorkerServiceClient(Channel channel) : base(channel)
277 {
278 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700279 public WorkerServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700280 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700281 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700282 ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary>
283 protected WorkerServiceClient() : base()
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700284 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700285 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700286 ///<summary>Protected constructor to allow creation of configured clients.</summary>
287 protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700288 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700289 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700290
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700291 /// <summary>
292 /// Start server with specified workload.
293 /// First request sent specifies the ServerConfig followed by ServerStatus
294 /// response. After that, a "Mark" can be sent anytime to request the latest
295 /// stats. Closing the stream will initiate shutdown of the test server
296 /// and once the shutdown has finished, the OK status is sent to terminate
297 /// this RPC.
298 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700299 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 -0700300 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700301 return RunServer(new CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700302 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700303 /// <summary>
304 /// Start server with specified workload.
305 /// First request sent specifies the ServerConfig followed by ServerStatus
306 /// response. After that, a "Mark" can be sent anytime to request the latest
307 /// stats. Closing the stream will initiate shutdown of the test server
308 /// and once the shutdown has finished, the OK status is sent to terminate
309 /// this RPC.
310 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700311 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800312 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700313 return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800314 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700315 /// <summary>
316 /// Start client with specified workload.
317 /// First request sent specifies the ClientConfig followed by ClientStatus
318 /// response. After that, a "Mark" can be sent anytime to request the latest
319 /// stats. Closing the stream will initiate shutdown of the test client
320 /// and once the shutdown has finished, the OK status is sent to terminate
321 /// this RPC.
322 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700323 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 -0800324 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700325 return RunClient(new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800326 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700327 /// <summary>
328 /// Start client with specified workload.
329 /// First request sent specifies the ClientConfig followed by ClientStatus
330 /// response. After that, a "Mark" can be sent anytime to request the latest
331 /// stats. Closing the stream will initiate shutdown of the test client
332 /// and once the shutdown has finished, the OK status is sent to terminate
333 /// this RPC.
334 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700335 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800336 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700337 return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800338 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700339 /// <summary>
340 /// Just return the core count - unary call
341 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700342 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 -0800343 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700344 return CoreCount(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800345 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700346 /// <summary>
347 /// Just return the core count - unary call
348 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700349 public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800350 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700351 return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800352 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700353 /// <summary>
354 /// Just return the core count - unary call
355 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700356 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 -0800357 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700358 return CoreCountAsync(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800359 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700360 /// <summary>
361 /// Just return the core count - unary call
362 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700363 public virtual AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800364 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700365 return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800366 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700367 /// <summary>
368 /// Quit this worker
369 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700370 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 -0800371 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700372 return QuitWorker(request, new CallOptions(headers, deadline, cancellationToken));
373 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700374 /// <summary>
375 /// Quit this worker
376 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700377 public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options)
378 {
379 return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request);
380 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700381 /// <summary>
382 /// Quit this worker
383 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700384 public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
385 {
386 return QuitWorkerAsync(request, new CallOptions(headers, deadline, cancellationToken));
387 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700388 /// <summary>
389 /// Quit this worker
390 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700391 public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options)
392 {
393 return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request);
394 }
395 protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration)
396 {
397 return new WorkerServiceClient(configuration);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800398 }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700399 }
400
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700401 /// <summary>Creates a new client for WorkerService</summary>
Jan Tattermusch7c0e1ee2016-04-25 16:00:34 -0700402 public static WorkerServiceClient NewClient(Channel channel)
403 {
404 return new WorkerServiceClient(channel);
405 }
406
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700407 /// <summary>Creates service definition that can be registered with a server</summary>
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700408 public static ServerServiceDefinition BindService(WorkerServiceBase serviceImpl)
409 {
Jan Tattermusch562cd052016-06-06 08:47:17 -0700410 return ServerServiceDefinition.CreateBuilder()
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700411 .AddMethod(__Method_RunServer, serviceImpl.RunServer)
412 .AddMethod(__Method_RunClient, serviceImpl.RunClient)
413 .AddMethod(__Method_CoreCount, serviceImpl.CoreCount)
414 .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build();
415 }
416
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700417 }
418}
419#endregion