blob: 54d81e225951e918e4d9cd0b9eff701a109ee4ee [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 {
Alexander Polcync0f4c2c2016-11-07 10:24:35 -080043 public static partial class BenchmarkService
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070044 {
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>
Alexander Polcync0f4c2c2016-11-07 10:24:35 -080071 public abstract partial class BenchmarkServiceBase
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070072 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070073 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +010074 /// One request followed by one response.
75 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070076 /// </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>
Jan Tattermusch726f40f2016-12-12 12:09:35 +010083 /// One request followed by one response.
84 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070085 /// </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>
Alexander Polcync0f4c2c2016-11-07 10:24:35 -080094 public partial class BenchmarkServiceClient : ClientBase<BenchmarkServiceClient>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070095 {
Jan Tattermusched6ea4c2016-06-22 12:38:44 -070096 /// <summary>Creates a new client for BenchmarkService</summary>
97 /// <param name="channel">The channel to use to make remote calls.</param>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070098 public BenchmarkServiceClient(Channel channel) : base(channel)
99 {
100 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700101 /// <summary>Creates a new client for BenchmarkService that uses a custom <c>CallInvoker</c>.</summary>
102 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700103 public BenchmarkServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700104 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700105 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700106 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700107 protected BenchmarkServiceClient() : base()
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700108 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700109 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700110 /// <summary>Protected constructor to allow creation of configured clients.</summary>
111 /// <param name="configuration">The client configuration.</param>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700112 protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700113 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700114 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700115
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700116 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100117 /// One request followed by one response.
118 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700119 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700120 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 -0700121 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700122 return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700123 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700124 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100125 /// One request followed by one response.
126 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700127 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700128 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700129 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700130 return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700131 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700132 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100133 /// One request followed by one response.
134 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700135 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700136 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 -0700137 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700138 return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken));
139 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700140 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100141 /// One request followed by one response.
142 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700143 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700144 public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options)
145 {
146 return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request);
147 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700148 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100149 /// One request followed by one response.
150 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700151 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700152 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
153 {
154 return StreamingCall(new CallOptions(headers, deadline, cancellationToken));
155 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700156 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100157 /// One request followed by one response.
158 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700159 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700160 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options)
161 {
162 return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options);
163 }
Jan Tattermusch10098d12016-10-06 13:15:12 +0200164 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700165 protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration)
166 {
167 return new BenchmarkServiceClient(configuration);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700168 }
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 }
Alexander Polcync0f4c2c2016-11-07 10:24:35 -0800180 public static partial class WorkerService
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700181 {
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>
Alexander Polcync0f4c2c2016-11-07 10:24:35 -0800227 public abstract partial class WorkerServiceBase
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700228 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700229 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100230 /// 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.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700236 /// </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>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100243 /// 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.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700249 /// </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>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100256 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700257 /// </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>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100264 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700265 /// </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>
Alexander Polcync0f4c2c2016-11-07 10:24:35 -0800274 public partial class WorkerServiceClient : ClientBase<WorkerServiceClient>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700275 {
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700276 /// <summary>Creates a new client for WorkerService</summary>
277 /// <param name="channel">The channel to use to make remote calls.</param>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700278 public WorkerServiceClient(Channel channel) : base(channel)
279 {
280 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700281 /// <summary>Creates a new client for WorkerService that uses a custom <c>CallInvoker</c>.</summary>
282 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700283 public WorkerServiceClient(CallInvoker callInvoker) : base(callInvoker)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700284 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700285 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700286 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700287 protected WorkerServiceClient() : base()
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700288 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700289 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700290 /// <summary>Protected constructor to allow creation of configured clients.</summary>
291 /// <param name="configuration">The client configuration.</param>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700292 protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700293 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700294 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700295
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700296 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100297 /// Start server with specified workload.
298 /// First request sent specifies the ServerConfig followed by ServerStatus
299 /// response. After that, a "Mark" can be sent anytime to request the latest
300 /// stats. Closing the stream will initiate shutdown of the test server
301 /// and once the shutdown has finished, the OK status is sent to terminate
302 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700303 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700304 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 -0700305 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700306 return RunServer(new CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700307 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700308 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100309 /// Start server with specified workload.
310 /// First request sent specifies the ServerConfig followed by ServerStatus
311 /// response. After that, a "Mark" can be sent anytime to request the latest
312 /// stats. Closing the stream will initiate shutdown of the test server
313 /// and once the shutdown has finished, the OK status is sent to terminate
314 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700315 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700316 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800317 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700318 return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800319 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700320 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100321 /// Start client with specified workload.
322 /// First request sent specifies the ClientConfig followed by ClientStatus
323 /// response. After that, a "Mark" can be sent anytime to request the latest
324 /// stats. Closing the stream will initiate shutdown of the test client
325 /// and once the shutdown has finished, the OK status is sent to terminate
326 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700327 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700328 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 -0800329 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700330 return RunClient(new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800331 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700332 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100333 /// Start client with specified workload.
334 /// First request sent specifies the ClientConfig followed by ClientStatus
335 /// response. After that, a "Mark" can be sent anytime to request the latest
336 /// stats. Closing the stream will initiate shutdown of the test client
337 /// and once the shutdown has finished, the OK status is sent to terminate
338 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700339 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700340 public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800341 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700342 return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800343 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700344 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100345 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700346 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700347 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 -0800348 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700349 return CoreCount(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800350 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700351 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100352 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700353 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700354 public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800355 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700356 return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800357 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700358 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100359 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700360 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700361 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 -0800362 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700363 return CoreCountAsync(request, new CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800364 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700365 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100366 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700367 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700368 public virtual AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800369 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700370 return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800371 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700372 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100373 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700374 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700375 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 -0800376 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700377 return QuitWorker(request, new CallOptions(headers, deadline, cancellationToken));
378 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700379 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100380 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700381 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700382 public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options)
383 {
384 return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request);
385 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700386 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100387 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700388 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700389 public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
390 {
391 return QuitWorkerAsync(request, new CallOptions(headers, deadline, cancellationToken));
392 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700393 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100394 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700395 /// </summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700396 public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options)
397 {
398 return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request);
399 }
Jan Tattermusch10098d12016-10-06 13:15:12 +0200400 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700401 protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration)
402 {
403 return new WorkerServiceClient(configuration);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800404 }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700405 }
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