Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 2 | // source: src/proto/grpc/testing/services.proto |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 3 | // 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 35 | #region Designer generated code |
| 36 | |
| 37 | using System; |
| 38 | using System.Threading; |
| 39 | using System.Threading.Tasks; |
| 40 | using Grpc.Core; |
| 41 | |
| 42 | namespace 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 64 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 65 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 66 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 67 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 68 | } |
| 69 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 70 | /// <summary>Base class for server-side implementations of BenchmarkService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 71 | public abstract class BenchmarkServiceBase |
| 72 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 73 | /// <summary> |
| 74 | /// One request followed by one response. |
| 75 | /// The server returns the client payload as-is. |
| 76 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 77 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 78 | { |
| 79 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 80 | } |
| 81 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 82 | /// <summary> |
| 83 | /// One request followed by one response. |
| 84 | /// The server returns the client payload as-is. |
| 85 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 86 | public virtual global::System.Threading.Tasks.Task StreamingCall(IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 87 | { |
| 88 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 89 | } |
| 90 | |
| 91 | } |
| 92 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 93 | /// <summary>Client for BenchmarkService</summary> |
Jan Tattermusch | fcc8d97 | 2016-06-06 09:44:02 -0700 | [diff] [blame^] | 94 | public class BenchmarkServiceClient : ClientBase<BenchmarkServiceClient> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 95 | { |
| 96 | public BenchmarkServiceClient(Channel channel) : base(channel) |
| 97 | { |
| 98 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 99 | public BenchmarkServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 100 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 101 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 102 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 103 | protected BenchmarkServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 104 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 105 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 106 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 107 | protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 108 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 109 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 110 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 111 | /// <summary> |
| 112 | /// One request followed by one response. |
| 113 | /// The server returns the client payload as-is. |
| 114 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 115 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 116 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 117 | return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 118 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 119 | /// <summary> |
| 120 | /// One request followed by one response. |
| 121 | /// The server returns the client payload as-is. |
| 122 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 123 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 124 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 125 | return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 126 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 127 | /// <summary> |
| 128 | /// One request followed by one response. |
| 129 | /// The server returns the client payload as-is. |
| 130 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 131 | public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 132 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 133 | return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 134 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 135 | /// <summary> |
| 136 | /// One request followed by one response. |
| 137 | /// The server returns the client payload as-is. |
| 138 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 139 | 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 143 | /// <summary> |
| 144 | /// One request followed by one response. |
| 145 | /// The server returns the client payload as-is. |
| 146 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 147 | 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 151 | /// <summary> |
| 152 | /// One request followed by one response. |
| 153 | /// The server returns the client payload as-is. |
| 154 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 155 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 162 | } |
| 163 | } |
| 164 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 165 | /// <summary>Creates a new client for BenchmarkService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 166 | public static BenchmarkServiceClient NewClient(Channel channel) |
| 167 | { |
| 168 | return new BenchmarkServiceClient(channel); |
| 169 | } |
| 170 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 171 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 172 | public static ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) |
| 173 | { |
Jan Tattermusch | 562cd05 | 2016-06-06 08:47:17 -0700 | [diff] [blame] | 174 | return ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 175 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 176 | .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build(); |
| 177 | } |
| 178 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 179 | } |
| 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 Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 188 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 191 | |
| 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 Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 206 | 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 220 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 221 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 222 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 223 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 224 | } |
| 225 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 226 | /// <summary>Base class for server-side implementations of WorkerService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 227 | public abstract class WorkerServiceBase |
| 228 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 229 | /// <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 Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 237 | public virtual global::System.Threading.Tasks.Task RunServer(IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 238 | { |
| 239 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 240 | } |
| 241 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 242 | /// <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 Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 250 | public virtual global::System.Threading.Tasks.Task RunClient(IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 251 | { |
| 252 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 253 | } |
| 254 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 255 | /// <summary> |
| 256 | /// Just return the core count - unary call |
| 257 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 258 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 259 | { |
| 260 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 261 | } |
| 262 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 263 | /// <summary> |
| 264 | /// Quit this worker |
| 265 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame] | 266 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 267 | { |
| 268 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 269 | } |
| 270 | |
| 271 | } |
| 272 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 273 | /// <summary>Client for WorkerService</summary> |
Jan Tattermusch | fcc8d97 | 2016-06-06 09:44:02 -0700 | [diff] [blame^] | 274 | public class WorkerServiceClient : ClientBase<WorkerServiceClient> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 275 | { |
| 276 | public WorkerServiceClient(Channel channel) : base(channel) |
| 277 | { |
| 278 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 279 | public WorkerServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 280 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 281 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 282 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 283 | protected WorkerServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 284 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 285 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 286 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 287 | protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 288 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 289 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 290 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 291 | /// <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 Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 299 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 300 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 301 | return RunServer(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 302 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 303 | /// <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 Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 311 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 312 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 313 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 314 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 315 | /// <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 Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 323 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 324 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 325 | return RunClient(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 326 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 327 | /// <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 Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 335 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 336 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 337 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 338 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 339 | /// <summary> |
| 340 | /// Just return the core count - unary call |
| 341 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 342 | public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 343 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 344 | return CoreCount(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 345 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 346 | /// <summary> |
| 347 | /// Just return the core count - unary call |
| 348 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 349 | public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 350 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 351 | return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 352 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 353 | /// <summary> |
| 354 | /// Just return the core count - unary call |
| 355 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 356 | public virtual AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 357 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 358 | return CoreCountAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 359 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 360 | /// <summary> |
| 361 | /// Just return the core count - unary call |
| 362 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 363 | public virtual AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 364 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 365 | return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 366 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 367 | /// <summary> |
| 368 | /// Quit this worker |
| 369 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 370 | public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 371 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 372 | return QuitWorker(request, new CallOptions(headers, deadline, cancellationToken)); |
| 373 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 374 | /// <summary> |
| 375 | /// Quit this worker |
| 376 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 377 | 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 381 | /// <summary> |
| 382 | /// Quit this worker |
| 383 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 384 | 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 388 | /// <summary> |
| 389 | /// Quit this worker |
| 390 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 391 | 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 Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 398 | } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 399 | } |
| 400 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 401 | /// <summary>Creates a new client for WorkerService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 402 | public static WorkerServiceClient NewClient(Channel channel) |
| 403 | { |
| 404 | return new WorkerServiceClient(channel); |
| 405 | } |
| 406 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 407 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 408 | public static ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) |
| 409 | { |
Jan Tattermusch | 562cd05 | 2016-06-06 08:47:17 -0700 | [diff] [blame] | 410 | return ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 411 | .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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 417 | } |
| 418 | } |
| 419 | #endregion |