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>Client for BenchmarkService</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 71 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 72 | public interface IBenchmarkServiceClient |
| 73 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 74 | /// <summary> |
| 75 | /// One request followed by one response. |
| 76 | /// The server returns the client payload as-is. |
| 77 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 78 | global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 79 | /// <summary> |
| 80 | /// One request followed by one response. |
| 81 | /// The server returns the client payload as-is. |
| 82 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 83 | global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 84 | /// <summary> |
| 85 | /// One request followed by one response. |
| 86 | /// The server returns the client payload as-is. |
| 87 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 88 | AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 89 | /// <summary> |
| 90 | /// One request followed by one response. |
| 91 | /// The server returns the client payload as-is. |
| 92 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 93 | AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 94 | /// <summary> |
| 95 | /// One request followed by one response. |
| 96 | /// The server returns the client payload as-is. |
| 97 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 98 | AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 99 | /// <summary> |
| 100 | /// One request followed by one response. |
| 101 | /// The server returns the client payload as-is. |
| 102 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 103 | AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options); |
| 104 | } |
| 105 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 106 | /// <summary>Interface of server-side implementations of BenchmarkService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 107 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 108 | public interface IBenchmarkService |
| 109 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 110 | /// <summary> |
| 111 | /// One request followed by one response. |
| 112 | /// The server returns the client payload as-is. |
| 113 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 114 | global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 115 | /// <summary> |
| 116 | /// One request followed by one response. |
| 117 | /// The server returns the client payload as-is. |
| 118 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 119 | global::System.Threading.Tasks.Task StreamingCall(IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, ServerCallContext context); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 120 | } |
| 121 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 122 | /// <summary>Base class for server-side implementations of BenchmarkService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 123 | public abstract class BenchmarkServiceBase |
| 124 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 125 | /// <summary> |
| 126 | /// One request followed by one response. |
| 127 | /// The server returns the client payload as-is. |
| 128 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 129 | 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] | 130 | { |
| 131 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 132 | } |
| 133 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 134 | /// <summary> |
| 135 | /// One request followed by one response. |
| 136 | /// The server returns the client payload as-is. |
| 137 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 138 | 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] | 139 | { |
| 140 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 141 | } |
| 142 | |
| 143 | } |
| 144 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 145 | /// <summary>Client for BenchmarkService</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 146 | #pragma warning disable 0618 |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 147 | public class BenchmarkServiceClient : ClientBase<BenchmarkServiceClient>, IBenchmarkServiceClient |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 148 | #pragma warning restore 0618 |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 149 | { |
| 150 | public BenchmarkServiceClient(Channel channel) : base(channel) |
| 151 | { |
| 152 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 153 | public BenchmarkServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 154 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 155 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 156 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 157 | protected BenchmarkServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 158 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 159 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 160 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 161 | protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 162 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 163 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 164 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 165 | /// <summary> |
| 166 | /// One request followed by one response. |
| 167 | /// The server returns the client payload as-is. |
| 168 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 169 | 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] | 170 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 171 | return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 172 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 173 | /// <summary> |
| 174 | /// One request followed by one response. |
| 175 | /// The server returns the client payload as-is. |
| 176 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 177 | 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] | 178 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 179 | return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 180 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 181 | /// <summary> |
| 182 | /// One request followed by one response. |
| 183 | /// The server returns the client payload as-is. |
| 184 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 185 | 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] | 186 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 187 | return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 188 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 189 | /// <summary> |
| 190 | /// One request followed by one response. |
| 191 | /// The server returns the client payload as-is. |
| 192 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 193 | public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
| 194 | { |
| 195 | return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); |
| 196 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 197 | /// <summary> |
| 198 | /// One request followed by one response. |
| 199 | /// The server returns the client payload as-is. |
| 200 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 201 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 202 | { |
| 203 | return StreamingCall(new CallOptions(headers, deadline, cancellationToken)); |
| 204 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 205 | /// <summary> |
| 206 | /// One request followed by one response. |
| 207 | /// The server returns the client payload as-is. |
| 208 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 209 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options) |
| 210 | { |
| 211 | return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); |
| 212 | } |
| 213 | protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 214 | { |
| 215 | return new BenchmarkServiceClient(configuration); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 216 | } |
| 217 | } |
| 218 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 219 | /// <summary>Creates a new client for BenchmarkService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 220 | public static BenchmarkServiceClient NewClient(Channel channel) |
| 221 | { |
| 222 | return new BenchmarkServiceClient(channel); |
| 223 | } |
| 224 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 225 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 226 | #pragma warning disable 0618 |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 227 | public static ServerServiceDefinition BindService(IBenchmarkService serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 228 | #pragma warning restore 0618 |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 229 | { |
| 230 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 231 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 232 | .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build(); |
| 233 | } |
| 234 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 235 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 236 | #pragma warning disable 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 237 | public static ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 238 | #pragma warning restore 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 239 | { |
| 240 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 241 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 242 | .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build(); |
| 243 | } |
| 244 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 245 | } |
| 246 | public static class WorkerService |
| 247 | { |
| 248 | static readonly string __ServiceName = "grpc.testing.WorkerService"; |
| 249 | |
| 250 | static readonly Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_ServerArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom); |
| 251 | static readonly Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_ServerStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom); |
| 252 | static readonly Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_ClientArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom); |
| 253 | 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] | 254 | static readonly Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_CoreRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom); |
| 255 | static readonly Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_CoreResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom); |
| 256 | 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] | 257 | |
| 258 | static readonly Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> __Method_RunServer = new Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>( |
| 259 | MethodType.DuplexStreaming, |
| 260 | __ServiceName, |
| 261 | "RunServer", |
| 262 | __Marshaller_ServerArgs, |
| 263 | __Marshaller_ServerStatus); |
| 264 | |
| 265 | static readonly Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> __Method_RunClient = new Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>( |
| 266 | MethodType.DuplexStreaming, |
| 267 | __ServiceName, |
| 268 | "RunClient", |
| 269 | __Marshaller_ClientArgs, |
| 270 | __Marshaller_ClientStatus); |
| 271 | |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 272 | static readonly Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse> __Method_CoreCount = new Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>( |
| 273 | MethodType.Unary, |
| 274 | __ServiceName, |
| 275 | "CoreCount", |
| 276 | __Marshaller_CoreRequest, |
| 277 | __Marshaller_CoreResponse); |
| 278 | |
| 279 | static readonly Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void> __Method_QuitWorker = new Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void>( |
| 280 | MethodType.Unary, |
| 281 | __ServiceName, |
| 282 | "QuitWorker", |
| 283 | __Marshaller_Void, |
| 284 | __Marshaller_Void); |
| 285 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 286 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 287 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 288 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 289 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 290 | } |
| 291 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 292 | /// <summary>Client for WorkerService</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 293 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 294 | public interface IWorkerServiceClient |
| 295 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 296 | /// <summary> |
| 297 | /// Start server with specified workload. |
| 298 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 299 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 300 | /// stats. Closing the stream will initiate shutdown of the test server |
| 301 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 302 | /// this RPC. |
| 303 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 304 | AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 305 | /// <summary> |
| 306 | /// Start server with specified workload. |
| 307 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 308 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 309 | /// stats. Closing the stream will initiate shutdown of the test server |
| 310 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 311 | /// this RPC. |
| 312 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 313 | AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 314 | /// <summary> |
| 315 | /// Start client with specified workload. |
| 316 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 317 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 318 | /// stats. Closing the stream will initiate shutdown of the test client |
| 319 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 320 | /// this RPC. |
| 321 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 322 | AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 323 | /// <summary> |
| 324 | /// Start client with specified workload. |
| 325 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 326 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 327 | /// stats. Closing the stream will initiate shutdown of the test client |
| 328 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 329 | /// this RPC. |
| 330 | /// </summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 331 | AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 332 | /// <summary> |
| 333 | /// Just return the core count - unary call |
| 334 | /// </summary> |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 335 | global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 336 | /// <summary> |
| 337 | /// Just return the core count - unary call |
| 338 | /// </summary> |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 339 | global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 340 | /// <summary> |
| 341 | /// Just return the core count - unary call |
| 342 | /// </summary> |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 343 | AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 344 | /// <summary> |
| 345 | /// Just return the core count - unary call |
| 346 | /// </summary> |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 347 | AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 348 | /// <summary> |
| 349 | /// Quit this worker |
| 350 | /// </summary> |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 351 | global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 352 | /// <summary> |
| 353 | /// Quit this worker |
| 354 | /// </summary> |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 355 | global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 356 | /// <summary> |
| 357 | /// Quit this worker |
| 358 | /// </summary> |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 359 | AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 360 | /// <summary> |
| 361 | /// Quit this worker |
| 362 | /// </summary> |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 363 | AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 364 | } |
| 365 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 366 | /// <summary>Interface of server-side implementations of WorkerService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 367 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 368 | public interface IWorkerService |
| 369 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 370 | /// <summary> |
| 371 | /// Start server with specified workload. |
| 372 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 373 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 374 | /// stats. Closing the stream will initiate shutdown of the test server |
| 375 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 376 | /// this RPC. |
| 377 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 378 | global::System.Threading.Tasks.Task RunServer(IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 379 | /// <summary> |
| 380 | /// Start client with specified workload. |
| 381 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 382 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 383 | /// stats. Closing the stream will initiate shutdown of the test client |
| 384 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 385 | /// this RPC. |
| 386 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 387 | global::System.Threading.Tasks.Task RunClient(IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 388 | /// <summary> |
| 389 | /// Just return the core count - unary call |
| 390 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 391 | global::System.Threading.Tasks.Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context); |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 392 | /// <summary> |
| 393 | /// Quit this worker |
| 394 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 395 | global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 396 | } |
| 397 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 398 | /// <summary>Base class for server-side implementations of WorkerService</summary> |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 399 | public abstract class WorkerServiceBase |
| 400 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 401 | /// <summary> |
| 402 | /// Start server with specified workload. |
| 403 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 404 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 405 | /// stats. Closing the stream will initiate shutdown of the test server |
| 406 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 407 | /// this RPC. |
| 408 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 409 | 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] | 410 | { |
| 411 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 412 | } |
| 413 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 414 | /// <summary> |
| 415 | /// Start client with specified workload. |
| 416 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 417 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 418 | /// stats. Closing the stream will initiate shutdown of the test client |
| 419 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 420 | /// this RPC. |
| 421 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 422 | 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] | 423 | { |
| 424 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 425 | } |
| 426 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 427 | /// <summary> |
| 428 | /// Just return the core count - unary call |
| 429 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 430 | 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] | 431 | { |
| 432 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 433 | } |
| 434 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 435 | /// <summary> |
| 436 | /// Quit this worker |
| 437 | /// </summary> |
Jan Tattermusch | d83f791 | 2016-05-09 10:28:10 -0700 | [diff] [blame^] | 438 | 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] | 439 | { |
| 440 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 441 | } |
| 442 | |
| 443 | } |
| 444 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 445 | /// <summary>Client for WorkerService</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 446 | #pragma warning disable 0618 |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 447 | public class WorkerServiceClient : ClientBase<WorkerServiceClient>, IWorkerServiceClient |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 448 | #pragma warning restore 0618 |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 449 | { |
| 450 | public WorkerServiceClient(Channel channel) : base(channel) |
| 451 | { |
| 452 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 453 | public WorkerServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 454 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 455 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 456 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 457 | protected WorkerServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 458 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 459 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 460 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 461 | protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 462 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 463 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 464 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 465 | /// <summary> |
| 466 | /// Start server with specified workload. |
| 467 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 468 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 469 | /// stats. Closing the stream will initiate shutdown of the test server |
| 470 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 471 | /// this RPC. |
| 472 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 473 | 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] | 474 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 475 | return RunServer(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 476 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 477 | /// <summary> |
| 478 | /// 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. |
| 484 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 485 | 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] | 486 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 487 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 488 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 489 | /// <summary> |
| 490 | /// Start client with specified workload. |
| 491 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 492 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 493 | /// stats. Closing the stream will initiate shutdown of the test client |
| 494 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 495 | /// this RPC. |
| 496 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 497 | 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] | 498 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 499 | return RunClient(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 500 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 501 | /// <summary> |
| 502 | /// Start client with specified workload. |
| 503 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 504 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 505 | /// stats. Closing the stream will initiate shutdown of the test client |
| 506 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 507 | /// this RPC. |
| 508 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 509 | 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] | 510 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 511 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 512 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 513 | /// <summary> |
| 514 | /// Just return the core count - unary call |
| 515 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 516 | 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] | 517 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 518 | return CoreCount(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 519 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 520 | /// <summary> |
| 521 | /// Just return the core count - unary call |
| 522 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 523 | 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] | 524 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 525 | return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 526 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 527 | /// <summary> |
| 528 | /// Just return the core count - unary call |
| 529 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 530 | 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] | 531 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 532 | return CoreCountAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 533 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 534 | /// <summary> |
| 535 | /// Just return the core count - unary call |
| 536 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 537 | 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] | 538 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 539 | return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 540 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 541 | /// <summary> |
| 542 | /// Quit this worker |
| 543 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 544 | 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] | 545 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 546 | return QuitWorker(request, new CallOptions(headers, deadline, cancellationToken)); |
| 547 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 548 | /// <summary> |
| 549 | /// Quit this worker |
| 550 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 551 | public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options) |
| 552 | { |
| 553 | return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); |
| 554 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 555 | /// <summary> |
| 556 | /// Quit this worker |
| 557 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 558 | public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 559 | { |
| 560 | return QuitWorkerAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 561 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 562 | /// <summary> |
| 563 | /// Quit this worker |
| 564 | /// </summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 565 | public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options) |
| 566 | { |
| 567 | return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); |
| 568 | } |
| 569 | protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 570 | { |
| 571 | return new WorkerServiceClient(configuration); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 572 | } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 573 | } |
| 574 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 575 | /// <summary>Creates a new client for WorkerService</summary> |
Jan Tattermusch | 7c0e1ee | 2016-04-25 16:00:34 -0700 | [diff] [blame] | 576 | public static WorkerServiceClient NewClient(Channel channel) |
| 577 | { |
| 578 | return new WorkerServiceClient(channel); |
| 579 | } |
| 580 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 581 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 582 | #pragma warning disable 0618 |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 583 | public static ServerServiceDefinition BindService(IWorkerService serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 584 | #pragma warning restore 0618 |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 585 | { |
| 586 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 587 | .AddMethod(__Method_RunServer, serviceImpl.RunServer) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 588 | .AddMethod(__Method_RunClient, serviceImpl.RunClient) |
| 589 | .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) |
| 590 | .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 591 | } |
| 592 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 593 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 594 | #pragma warning disable 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 595 | public static ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) |
Jan Tattermusch | 55fad17 | 2016-04-25 13:42:28 -0700 | [diff] [blame] | 596 | #pragma warning restore 0618 |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 597 | { |
| 598 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 599 | .AddMethod(__Method_RunServer, serviceImpl.RunServer) |
| 600 | .AddMethod(__Method_RunClient, serviceImpl.RunClient) |
| 601 | .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) |
| 602 | .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); |
| 603 | } |
| 604 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 605 | } |
| 606 | } |
| 607 | #endregion |