blob: d2e4f2e4a5b2b4203f8e03b00792e14135b41723 [file] [log] [blame]
Jan Tattermusch386bbdf2017-12-13 02:42:22 +01001// <auto-generated>
2// Generated by the protocol buffer compiler. DO NOT EDIT!
3// source: src/proto/grpc/testing/services.proto
4// </auto-generated>
Jan Tattermuschbfee01d2016-04-28 10:52:41 -07005// Original file comments:
Jan Tattermusch4d5c3102017-06-07 10:23:56 +02006// Copyright 2015 gRPC authors.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -07007//
Jan Tattermusch4d5c3102017-06-07 10:23:56 +02008// Licensed under the Apache License, Version 2.0 (the "License");
9// you may not use this file except in compliance with the License.
10// You may obtain a copy of the License at
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070011//
Jan Tattermusch4d5c3102017-06-07 10:23:56 +020012// http://www.apache.org/licenses/LICENSE-2.0
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070013//
Jan Tattermusch4d5c3102017-06-07 10:23:56 +020014// Unless required by applicable law or agreed to in writing, software
15// distributed under the License is distributed on an "AS IS" BASIS,
16// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17// See the License for the specific language governing permissions and
18// limitations under the License.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070019//
20// An integration test service that covers all the method signature permutations
21// of unary/streaming requests/responses.
Jan Tattermuschca254732017-08-09 08:47:34 +020022#pragma warning disable 1591
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070023#region Designer generated code
24
25using System;
26using System.Threading;
27using System.Threading.Tasks;
Jan Tattermuschff4fc132017-03-14 09:27:50 +010028using grpc = global::Grpc.Core;
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070029
30namespace Grpc.Testing {
Alexander Polcync0f4c2c2016-11-07 10:24:35 -080031 public static partial class BenchmarkService
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070032 {
33 static readonly string __ServiceName = "grpc.testing.BenchmarkService";
34
Jan Tattermuschff4fc132017-03-14 09:27:50 +010035 static readonly grpc::Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom);
36 static readonly grpc::Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070037
Jan Tattermuschff4fc132017-03-14 09:27:50 +010038 static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
39 grpc::MethodType.Unary,
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070040 __ServiceName,
41 "UnaryCall",
42 __Marshaller_SimpleRequest,
43 __Marshaller_SimpleResponse);
44
Jan Tattermuschff4fc132017-03-14 09:27:50 +010045 static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingCall = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
46 grpc::MethodType.DuplexStreaming,
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070047 __ServiceName,
48 "StreamingCall",
49 __Marshaller_SimpleRequest,
50 __Marshaller_SimpleResponse);
51
Jan Tattermuscheb0219b2017-06-27 17:04:04 +020052 static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingFromClient = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
53 grpc::MethodType.ClientStreaming,
54 __ServiceName,
55 "StreamingFromClient",
56 __Marshaller_SimpleRequest,
57 __Marshaller_SimpleResponse);
58
59 static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingFromServer = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
60 grpc::MethodType.ServerStreaming,
61 __ServiceName,
62 "StreamingFromServer",
63 __Marshaller_SimpleRequest,
64 __Marshaller_SimpleResponse);
65
66 static readonly grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingBothWays = new grpc::Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>(
67 grpc::MethodType.DuplexStreaming,
68 __ServiceName,
69 "StreamingBothWays",
70 __Marshaller_SimpleRequest,
71 __Marshaller_SimpleResponse);
72
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070073 /// <summary>Service descriptor</summary>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070074 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
75 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -080076 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -070077 }
78
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070079 /// <summary>Base class for server-side implementations of BenchmarkService</summary>
Alexander Polcync0f4c2c2016-11-07 10:24:35 -080080 public abstract partial class BenchmarkServiceBase
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070081 {
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 Tattermusch00f66362016-12-12 13:02:29 +010086 /// <param name="request">The request received from the client.</param>
87 /// <param name="context">The context of the server-side call handler being invoked.</param>
88 /// <returns>The response to send back to the client (wrapped by a task).</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +010089 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070090 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +010091 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -070092 }
93
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070094 /// <summary>
Jan Tattermuscheb0219b2017-06-27 17:04:04 +020095 /// Repeated sequence of one request followed by one response.
96 /// Should be called streaming ping-pong
97 /// The server returns the client payload as-is on each response
Jan Tattermuschbfee01d2016-04-28 10:52:41 -070098 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +010099 /// <param name="requestStream">Used for reading requests from the client.</param>
100 /// <param name="responseStream">Used for sending responses back to the client.</param>
101 /// <param name="context">The context of the server-side call handler being invoked.</param>
102 /// <returns>A task indicating completion of the handler.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100103 public virtual global::System.Threading.Tasks.Task StreamingCall(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700104 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100105 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700106 }
107
Jan Tattermuscheb0219b2017-06-27 17:04:04 +0200108 /// <summary>
109 /// Single-sided unbounded streaming from client to server
110 /// The server returns the client payload as-is once the client does WritesDone
111 /// </summary>
112 /// <param name="requestStream">Used for reading requests from the client.</param>
113 /// <param name="context">The context of the server-side call handler being invoked.</param>
114 /// <returns>The response to send back to the client (wrapped by a task).</returns>
115 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::ServerCallContext context)
116 {
117 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
118 }
119
120 /// <summary>
121 /// Single-sided unbounded streaming from server to client
122 /// The server repeatedly returns the client payload as-is
123 /// </summary>
124 /// <param name="request">The request received from the client.</param>
125 /// <param name="responseStream">Used for sending responses back to the client.</param>
126 /// <param name="context">The context of the server-side call handler being invoked.</param>
127 /// <returns>A task indicating completion of the handler.</returns>
128 public virtual global::System.Threading.Tasks.Task StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context)
129 {
130 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
131 }
132
133 /// <summary>
134 /// Two-sided unbounded streaming between server to client
135 /// Both sides send the content of their own choice to the other
136 /// </summary>
137 /// <param name="requestStream">Used for reading requests from the client.</param>
138 /// <param name="responseStream">Used for sending responses back to the client.</param>
139 /// <param name="context">The context of the server-side call handler being invoked.</param>
140 /// <returns>A task indicating completion of the handler.</returns>
141 public virtual global::System.Threading.Tasks.Task StreamingBothWays(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context)
142 {
143 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
144 }
145
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700146 }
147
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700148 /// <summary>Client for BenchmarkService</summary>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100149 public partial class BenchmarkServiceClient : grpc::ClientBase<BenchmarkServiceClient>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700150 {
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700151 /// <summary>Creates a new client for BenchmarkService</summary>
152 /// <param name="channel">The channel to use to make remote calls.</param>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100153 public BenchmarkServiceClient(grpc::Channel channel) : base(channel)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700154 {
155 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700156 /// <summary>Creates a new client for BenchmarkService that uses a custom <c>CallInvoker</c>.</summary>
157 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100158 public BenchmarkServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700159 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700160 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700161 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700162 protected BenchmarkServiceClient() : base()
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700163 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700164 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700165 /// <summary>Protected constructor to allow creation of configured clients.</summary>
166 /// <param name="configuration">The client configuration.</param>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700167 protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700168 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700169 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700170
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700171 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100172 /// One request followed by one response.
173 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700174 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100175 /// <param name="request">The request to send to the server.</param>
176 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
177 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
178 /// <param name="cancellationToken">An optional token for canceling the call.</param>
179 /// <returns>The response received from the server.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100180 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700181 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100182 return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700183 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700184 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100185 /// One request followed by one response.
186 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700187 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100188 /// <param name="request">The request to send to the server.</param>
189 /// <param name="options">The options for the call.</param>
190 /// <returns>The response received from the server.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100191 public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700192 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700193 return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700194 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700195 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100196 /// One request followed by one response.
197 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700198 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100199 /// <param name="request">The request to send to the server.</param>
200 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
201 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
202 /// <param name="cancellationToken">An optional token for canceling the call.</param>
203 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100204 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700205 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100206 return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700207 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700208 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100209 /// One request followed by one response.
210 /// The server returns the client payload as-is.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700211 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100212 /// <param name="request">The request to send to the server.</param>
213 /// <param name="options">The options for the call.</param>
214 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100215 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700216 {
217 return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request);
218 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700219 /// <summary>
Jan Tattermuscheb0219b2017-06-27 17:04:04 +0200220 /// Repeated sequence of one request followed by one response.
221 /// Should be called streaming ping-pong
222 /// The server returns the client payload as-is on each response
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700223 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100224 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
225 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
226 /// <param name="cancellationToken">An optional token for canceling the call.</param>
227 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100228 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700229 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100230 return StreamingCall(new grpc::CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700231 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700232 /// <summary>
Jan Tattermuscheb0219b2017-06-27 17:04:04 +0200233 /// Repeated sequence of one request followed by one response.
234 /// Should be called streaming ping-pong
235 /// The server returns the client payload as-is on each response
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700236 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100237 /// <param name="options">The options for the call.</param>
238 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100239 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(grpc::CallOptions options)
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700240 {
241 return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options);
242 }
Jan Tattermuscheb0219b2017-06-27 17:04:04 +0200243 /// <summary>
244 /// Single-sided unbounded streaming from client to server
245 /// The server returns the client payload as-is once the client does WritesDone
246 /// </summary>
247 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
248 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
249 /// <param name="cancellationToken">An optional token for canceling the call.</param>
250 /// <returns>The call object.</returns>
251 public virtual grpc::AsyncClientStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
252 {
253 return StreamingFromClient(new grpc::CallOptions(headers, deadline, cancellationToken));
254 }
255 /// <summary>
256 /// Single-sided unbounded streaming from client to server
257 /// The server returns the client payload as-is once the client does WritesDone
258 /// </summary>
259 /// <param name="options">The options for the call.</param>
260 /// <returns>The call object.</returns>
261 public virtual grpc::AsyncClientStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::CallOptions options)
262 {
263 return CallInvoker.AsyncClientStreamingCall(__Method_StreamingFromClient, null, options);
264 }
265 /// <summary>
266 /// Single-sided unbounded streaming from server to client
267 /// The server repeatedly returns the client payload as-is
268 /// </summary>
269 /// <param name="request">The request to send to the server.</param>
270 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
271 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
272 /// <param name="cancellationToken">An optional token for canceling the call.</param>
273 /// <returns>The call object.</returns>
274 public virtual grpc::AsyncServerStreamingCall<global::Grpc.Testing.SimpleResponse> StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
275 {
276 return StreamingFromServer(request, new grpc::CallOptions(headers, deadline, cancellationToken));
277 }
278 /// <summary>
279 /// Single-sided unbounded streaming from server to client
280 /// The server repeatedly returns the client payload as-is
281 /// </summary>
282 /// <param name="request">The request to send to the server.</param>
283 /// <param name="options">The options for the call.</param>
284 /// <returns>The call object.</returns>
285 public virtual grpc::AsyncServerStreamingCall<global::Grpc.Testing.SimpleResponse> StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options)
286 {
287 return CallInvoker.AsyncServerStreamingCall(__Method_StreamingFromServer, null, options, request);
288 }
289 /// <summary>
290 /// Two-sided unbounded streaming between server to client
291 /// Both sides send the content of their own choice to the other
292 /// </summary>
293 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
294 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
295 /// <param name="cancellationToken">An optional token for canceling the call.</param>
296 /// <returns>The call object.</returns>
297 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingBothWays(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
298 {
299 return StreamingBothWays(new grpc::CallOptions(headers, deadline, cancellationToken));
300 }
301 /// <summary>
302 /// Two-sided unbounded streaming between server to client
303 /// Both sides send the content of their own choice to the other
304 /// </summary>
305 /// <param name="options">The options for the call.</param>
306 /// <returns>The call object.</returns>
307 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingBothWays(grpc::CallOptions options)
308 {
309 return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingBothWays, null, options);
310 }
Jan Tattermusch10098d12016-10-06 13:15:12 +0200311 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700312 protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration)
313 {
314 return new BenchmarkServiceClient(configuration);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700315 }
316 }
317
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700318 /// <summary>Creates service definition that can be registered with a server</summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100319 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100320 public static grpc::ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700321 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100322 return grpc::ServerServiceDefinition.CreateBuilder()
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700323 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall)
Jan Tattermuscheb0219b2017-06-27 17:04:04 +0200324 .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall)
325 .AddMethod(__Method_StreamingFromClient, serviceImpl.StreamingFromClient)
326 .AddMethod(__Method_StreamingFromServer, serviceImpl.StreamingFromServer)
327 .AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays).Build();
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700328 }
329
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700330 }
Alexander Polcync0f4c2c2016-11-07 10:24:35 -0800331 public static partial class WorkerService
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700332 {
333 static readonly string __ServiceName = "grpc.testing.WorkerService";
334
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100335 static readonly grpc::Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_ServerArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom);
336 static readonly grpc::Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_ServerStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom);
337 static readonly grpc::Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_ClientArgs = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom);
338 static readonly grpc::Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_ClientStatus = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom);
339 static readonly grpc::Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_CoreRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom);
340 static readonly grpc::Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_CoreResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom);
341 static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700342
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100343 static readonly grpc::Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> __Method_RunServer = new grpc::Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>(
344 grpc::MethodType.DuplexStreaming,
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700345 __ServiceName,
346 "RunServer",
347 __Marshaller_ServerArgs,
348 __Marshaller_ServerStatus);
349
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100350 static readonly grpc::Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> __Method_RunClient = new grpc::Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>(
351 grpc::MethodType.DuplexStreaming,
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700352 __ServiceName,
353 "RunClient",
354 __Marshaller_ClientArgs,
355 __Marshaller_ClientStatus);
356
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100357 static readonly grpc::Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse> __Method_CoreCount = new grpc::Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>(
358 grpc::MethodType.Unary,
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800359 __ServiceName,
360 "CoreCount",
361 __Marshaller_CoreRequest,
362 __Marshaller_CoreResponse);
363
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100364 static readonly grpc::Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void> __Method_QuitWorker = new grpc::Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void>(
365 grpc::MethodType.Unary,
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800366 __ServiceName,
367 "QuitWorker",
368 __Marshaller_Void,
369 __Marshaller_Void);
370
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700371 /// <summary>Service descriptor</summary>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700372 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
373 {
Jan Tattermusch72ce4422016-01-20 13:54:38 -0800374 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700375 }
376
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700377 /// <summary>Base class for server-side implementations of WorkerService</summary>
Alexander Polcync0f4c2c2016-11-07 10:24:35 -0800378 public abstract partial class WorkerServiceBase
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700379 {
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700380 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100381 /// Start server with specified workload.
382 /// First request sent specifies the ServerConfig followed by ServerStatus
383 /// response. After that, a "Mark" can be sent anytime to request the latest
384 /// stats. Closing the stream will initiate shutdown of the test server
385 /// and once the shutdown has finished, the OK status is sent to terminate
386 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700387 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100388 /// <param name="requestStream">Used for reading requests from the client.</param>
389 /// <param name="responseStream">Used for sending responses back to the client.</param>
390 /// <param name="context">The context of the server-side call handler being invoked.</param>
391 /// <returns>A task indicating completion of the handler.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100392 public virtual global::System.Threading.Tasks.Task RunServer(grpc::IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, grpc::ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700393 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100394 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700395 }
396
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700397 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100398 /// Start client with specified workload.
399 /// First request sent specifies the ClientConfig followed by ClientStatus
400 /// response. After that, a "Mark" can be sent anytime to request the latest
401 /// stats. Closing the stream will initiate shutdown of the test client
402 /// and once the shutdown has finished, the OK status is sent to terminate
403 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700404 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100405 /// <param name="requestStream">Used for reading requests from the client.</param>
406 /// <param name="responseStream">Used for sending responses back to the client.</param>
407 /// <param name="context">The context of the server-side call handler being invoked.</param>
408 /// <returns>A task indicating completion of the handler.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100409 public virtual global::System.Threading.Tasks.Task RunClient(grpc::IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, grpc::IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, grpc::ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700410 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100411 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700412 }
413
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700414 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100415 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700416 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100417 /// <param name="request">The request received from the client.</param>
418 /// <param name="context">The context of the server-side call handler being invoked.</param>
419 /// <returns>The response to send back to the client (wrapped by a task).</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100420 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, grpc::ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700421 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100422 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700423 }
424
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700425 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100426 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700427 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100428 /// <param name="request">The request received from the client.</param>
429 /// <param name="context">The context of the server-side call handler being invoked.</param>
430 /// <returns>The response to send back to the client (wrapped by a task).</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100431 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, grpc::ServerCallContext context)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700432 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100433 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700434 }
435
436 }
437
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700438 /// <summary>Client for WorkerService</summary>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100439 public partial class WorkerServiceClient : grpc::ClientBase<WorkerServiceClient>
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700440 {
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700441 /// <summary>Creates a new client for WorkerService</summary>
442 /// <param name="channel">The channel to use to make remote calls.</param>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100443 public WorkerServiceClient(grpc::Channel channel) : base(channel)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700444 {
445 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700446 /// <summary>Creates a new client for WorkerService that uses a custom <c>CallInvoker</c>.</summary>
447 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100448 public WorkerServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700449 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700450 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700451 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700452 protected WorkerServiceClient() : base()
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700453 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700454 }
Jan Tattermusched6ea4c2016-06-22 12:38:44 -0700455 /// <summary>Protected constructor to allow creation of configured clients.</summary>
456 /// <param name="configuration">The client configuration.</param>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700457 protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration)
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700458 {
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700459 }
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700460
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700461 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100462 /// Start server with specified workload.
463 /// First request sent specifies the ServerConfig followed by ServerStatus
464 /// response. After that, a "Mark" can be sent anytime to request the latest
465 /// stats. Closing the stream will initiate shutdown of the test server
466 /// and once the shutdown has finished, the OK status is sent to terminate
467 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700468 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100469 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
470 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
471 /// <param name="cancellationToken">An optional token for canceling the call.</param>
472 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100473 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700474 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100475 return RunServer(new grpc::CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700476 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700477 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100478 /// Start server with specified workload.
479 /// First request sent specifies the ServerConfig followed by ServerStatus
480 /// response. After that, a "Mark" can be sent anytime to request the latest
481 /// stats. Closing the stream will initiate shutdown of the test server
482 /// and once the shutdown has finished, the OK status is sent to terminate
483 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700484 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100485 /// <param name="options">The options for the call.</param>
486 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100487 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(grpc::CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800488 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700489 return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800490 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700491 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100492 /// Start client with specified workload.
493 /// First request sent specifies the ClientConfig followed by ClientStatus
494 /// response. After that, a "Mark" can be sent anytime to request the latest
495 /// stats. Closing the stream will initiate shutdown of the test client
496 /// and once the shutdown has finished, the OK status is sent to terminate
497 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700498 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100499 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
500 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
501 /// <param name="cancellationToken">An optional token for canceling the call.</param>
502 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100503 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800504 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100505 return RunClient(new grpc::CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800506 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700507 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100508 /// Start client with specified workload.
509 /// First request sent specifies the ClientConfig followed by ClientStatus
510 /// response. After that, a "Mark" can be sent anytime to request the latest
511 /// stats. Closing the stream will initiate shutdown of the test client
512 /// and once the shutdown has finished, the OK status is sent to terminate
513 /// this RPC.
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700514 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100515 /// <param name="options">The options for the call.</param>
516 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100517 public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(grpc::CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800518 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700519 return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800520 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700521 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100522 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700523 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100524 /// <param name="request">The request to send to the server.</param>
525 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
526 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
527 /// <param name="cancellationToken">An optional token for canceling the call.</param>
528 /// <returns>The response received from the server.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100529 public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800530 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100531 return CoreCount(request, new grpc::CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800532 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700533 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100534 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700535 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100536 /// <param name="request">The request to send to the server.</param>
537 /// <param name="options">The options for the call.</param>
538 /// <returns>The response received from the server.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100539 public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800540 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700541 return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800542 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700543 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100544 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700545 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100546 /// <param name="request">The request to send to the server.</param>
547 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
548 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
549 /// <param name="cancellationToken">An optional token for canceling the call.</param>
550 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100551 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800552 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100553 return CoreCountAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800554 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700555 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100556 /// Just return the core count - unary call
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700557 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100558 /// <param name="request">The request to send to the server.</param>
559 /// <param name="options">The options for the call.</param>
560 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100561 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options)
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800562 {
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700563 return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800564 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700565 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100566 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700567 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100568 /// <param name="request">The request to send to the server.</param>
569 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
570 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
571 /// <param name="cancellationToken">An optional token for canceling the call.</param>
572 /// <returns>The response received from the server.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100573 public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800574 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100575 return QuitWorker(request, new grpc::CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700576 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700577 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100578 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700579 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100580 /// <param name="request">The request to send to the server.</param>
581 /// <param name="options">The options for the call.</param>
582 /// <returns>The response received from the server.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100583 public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::CallOptions options)
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700584 {
585 return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request);
586 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700587 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100588 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700589 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100590 /// <param name="request">The request to send to the server.</param>
591 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
592 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
593 /// <param name="cancellationToken">An optional token for canceling the call.</param>
594 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100595 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700596 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100597 return QuitWorkerAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700598 }
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700599 /// <summary>
Jan Tattermusch726f40f2016-12-12 12:09:35 +0100600 /// Quit this worker
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700601 /// </summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100602 /// <param name="request">The request to send to the server.</param>
603 /// <param name="options">The options for the call.</param>
604 /// <returns>The call object.</returns>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100605 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::CallOptions options)
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700606 {
607 return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request);
608 }
Jan Tattermusch10098d12016-10-06 13:15:12 +0200609 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
Jan Tattermuschddc4e342016-03-21 19:03:14 -0700610 protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration)
611 {
612 return new WorkerServiceClient(configuration);
Jan Tattermusch1cbb5672016-02-18 14:27:28 -0800613 }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700614 }
615
Jan Tattermuschbfee01d2016-04-28 10:52:41 -0700616 /// <summary>Creates service definition that can be registered with a server</summary>
Jan Tattermusch00f66362016-12-12 13:02:29 +0100617 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100618 public static grpc::ServerServiceDefinition BindService(WorkerServiceBase serviceImpl)
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700619 {
Jan Tattermuschff4fc132017-03-14 09:27:50 +0100620 return grpc::ServerServiceDefinition.CreateBuilder()
Jan Tattermuscheeef5ed2016-03-14 16:08:39 -0700621 .AddMethod(__Method_RunServer, serviceImpl.RunServer)
622 .AddMethod(__Method_RunClient, serviceImpl.RunClient)
623 .AddMethod(__Method_CoreCount, serviceImpl.CoreCount)
624 .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build();
625 }
626
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700627 }
Jan Tattermuscheb0219b2017-06-27 17:04:04 +0200628 public static partial class ReportQpsScenarioService
629 {
630 static readonly string __ServiceName = "grpc.testing.ReportQpsScenarioService";
631
632 static readonly grpc::Marshaller<global::Grpc.Testing.ScenarioResult> __Marshaller_ScenarioResult = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ScenarioResult.Parser.ParseFrom);
633 static readonly grpc::Marshaller<global::Grpc.Testing.Void> __Marshaller_Void = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom);
634
635 static readonly grpc::Method<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void> __Method_ReportScenario = new grpc::Method<global::Grpc.Testing.ScenarioResult, global::Grpc.Testing.Void>(
636 grpc::MethodType.Unary,
637 __ServiceName,
638 "ReportScenario",
639 __Marshaller_ScenarioResult,
640 __Marshaller_Void);
641
642 /// <summary>Service descriptor</summary>
643 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
644 {
645 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[2]; }
646 }
647
648 /// <summary>Base class for server-side implementations of ReportQpsScenarioService</summary>
649 public abstract partial class ReportQpsScenarioServiceBase
650 {
651 /// <summary>
652 /// Report results of a QPS test benchmark scenario.
653 /// </summary>
654 /// <param name="request">The request received from the client.</param>
655 /// <param name="context">The context of the server-side call handler being invoked.</param>
656 /// <returns>The response to send back to the client (wrapped by a task).</returns>
657 public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::ServerCallContext context)
658 {
659 throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
660 }
661
662 }
663
664 /// <summary>Client for ReportQpsScenarioService</summary>
665 public partial class ReportQpsScenarioServiceClient : grpc::ClientBase<ReportQpsScenarioServiceClient>
666 {
667 /// <summary>Creates a new client for ReportQpsScenarioService</summary>
668 /// <param name="channel">The channel to use to make remote calls.</param>
669 public ReportQpsScenarioServiceClient(grpc::Channel channel) : base(channel)
670 {
671 }
672 /// <summary>Creates a new client for ReportQpsScenarioService that uses a custom <c>CallInvoker</c>.</summary>
673 /// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
674 public ReportQpsScenarioServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
675 {
676 }
677 /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
678 protected ReportQpsScenarioServiceClient() : base()
679 {
680 }
681 /// <summary>Protected constructor to allow creation of configured clients.</summary>
682 /// <param name="configuration">The client configuration.</param>
683 protected ReportQpsScenarioServiceClient(ClientBaseConfiguration configuration) : base(configuration)
684 {
685 }
686
687 /// <summary>
688 /// Report results of a QPS test benchmark scenario.
689 /// </summary>
690 /// <param name="request">The request to send to the server.</param>
691 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
692 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
693 /// <param name="cancellationToken">An optional token for canceling the call.</param>
694 /// <returns>The response received from the server.</returns>
695 public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
696 {
697 return ReportScenario(request, new grpc::CallOptions(headers, deadline, cancellationToken));
698 }
699 /// <summary>
700 /// Report results of a QPS test benchmark scenario.
701 /// </summary>
702 /// <param name="request">The request to send to the server.</param>
703 /// <param name="options">The options for the call.</param>
704 /// <returns>The response received from the server.</returns>
705 public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options)
706 {
707 return CallInvoker.BlockingUnaryCall(__Method_ReportScenario, null, options, request);
708 }
709 /// <summary>
710 /// Report results of a QPS test benchmark scenario.
711 /// </summary>
712 /// <param name="request">The request to send to the server.</param>
713 /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
714 /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
715 /// <param name="cancellationToken">An optional token for canceling the call.</param>
716 /// <returns>The call object.</returns>
717 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
718 {
719 return ReportScenarioAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
720 }
721 /// <summary>
722 /// Report results of a QPS test benchmark scenario.
723 /// </summary>
724 /// <param name="request">The request to send to the server.</param>
725 /// <param name="options">The options for the call.</param>
726 /// <returns>The call object.</returns>
727 public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options)
728 {
729 return CallInvoker.AsyncUnaryCall(__Method_ReportScenario, null, options, request);
730 }
731 /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
732 protected override ReportQpsScenarioServiceClient NewInstance(ClientBaseConfiguration configuration)
733 {
734 return new ReportQpsScenarioServiceClient(configuration);
735 }
736 }
737
738 /// <summary>Creates service definition that can be registered with a server</summary>
739 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
740 public static grpc::ServerServiceDefinition BindService(ReportQpsScenarioServiceBase serviceImpl)
741 {
742 return grpc::ServerServiceDefinition.CreateBuilder()
743 .AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario).Build();
744 }
745
746 }
Jan Tattermuschd0c1bfa2015-10-22 19:14:57 -0700747}
748#endregion