Jan Tattermusch | 386bbdf | 2017-12-13 02:42:22 +0100 | [diff] [blame] | 1 | // <auto-generated> |
| 2 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 3 | // source: src/proto/grpc/testing/services.proto |
| 4 | // </auto-generated> |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 5 | // Original file comments: |
Jan Tattermusch | 4d5c310 | 2017-06-07 10:23:56 +0200 | [diff] [blame] | 6 | // Copyright 2015 gRPC authors. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 7 | // |
Jan Tattermusch | 4d5c310 | 2017-06-07 10:23:56 +0200 | [diff] [blame] | 8 | // 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 11 | // |
Jan Tattermusch | 4d5c310 | 2017-06-07 10:23:56 +0200 | [diff] [blame] | 12 | // http://www.apache.org/licenses/LICENSE-2.0 |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 13 | // |
Jan Tattermusch | 4d5c310 | 2017-06-07 10:23:56 +0200 | [diff] [blame] | 14 | // 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 19 | // |
| 20 | // An integration test service that covers all the method signature permutations |
| 21 | // of unary/streaming requests/responses. |
Jan Tattermusch | ca25473 | 2017-08-09 08:47:34 +0200 | [diff] [blame] | 22 | #pragma warning disable 1591 |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 23 | #region Designer generated code |
| 24 | |
| 25 | using System; |
| 26 | using System.Threading; |
| 27 | using System.Threading.Tasks; |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 28 | using grpc = global::Grpc.Core; |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 29 | |
| 30 | namespace Grpc.Testing { |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 31 | public static partial class BenchmarkService |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 32 | { |
| 33 | static readonly string __ServiceName = "grpc.testing.BenchmarkService"; |
| 34 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 35 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 37 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 38 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 40 | __ServiceName, |
| 41 | "UnaryCall", |
| 42 | __Marshaller_SimpleRequest, |
| 43 | __Marshaller_SimpleResponse); |
| 44 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 45 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 47 | __ServiceName, |
| 48 | "StreamingCall", |
| 49 | __Marshaller_SimpleRequest, |
| 50 | __Marshaller_SimpleResponse); |
| 51 | |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame] | 52 | 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 73 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 74 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 75 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 76 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 77 | } |
| 78 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 79 | /// <summary>Base class for server-side implementations of BenchmarkService</summary> |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 80 | public abstract partial class BenchmarkServiceBase |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 81 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 82 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 83 | /// One request followed by one response. |
| 84 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 85 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 86 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 89 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 90 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 91 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 92 | } |
| 93 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 94 | /// <summary> |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame] | 95 | /// 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 98 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 99 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 103 | 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 Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 104 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 105 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame] | 108 | /// <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 Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 146 | } |
| 147 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 148 | /// <summary>Client for BenchmarkService</summary> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 149 | public partial class BenchmarkServiceClient : grpc::ClientBase<BenchmarkServiceClient> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 150 | { |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 151 | /// <summary>Creates a new client for BenchmarkService</summary> |
| 152 | /// <param name="channel">The channel to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 153 | public BenchmarkServiceClient(grpc::Channel channel) : base(channel) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 154 | { |
| 155 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 156 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 158 | public BenchmarkServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 159 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 160 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 161 | /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 162 | protected BenchmarkServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 163 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 164 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 165 | /// <summary>Protected constructor to allow creation of configured clients.</summary> |
| 166 | /// <param name="configuration">The client configuration.</param> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 167 | protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 168 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 169 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 170 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 171 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 172 | /// One request followed by one response. |
| 173 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 174 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 175 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 180 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 181 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 182 | return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 183 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 184 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 185 | /// One request followed by one response. |
| 186 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 187 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 188 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 191 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 192 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 193 | return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 194 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 195 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 196 | /// One request followed by one response. |
| 197 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 198 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 199 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 204 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 205 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 206 | return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 207 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 208 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 209 | /// One request followed by one response. |
| 210 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 211 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 212 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 215 | public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 216 | { |
| 217 | return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); |
| 218 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 219 | /// <summary> |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame] | 220 | /// 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 223 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 224 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 228 | 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 Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 229 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 230 | return StreamingCall(new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 231 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 232 | /// <summary> |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame] | 233 | /// 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 236 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 237 | /// <param name="options">The options for the call.</param> |
| 238 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 239 | public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(grpc::CallOptions options) |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 240 | { |
| 241 | return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); |
| 242 | } |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame] | 243 | /// <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 Tattermusch | 10098d1 | 2016-10-06 13:15:12 +0200 | [diff] [blame] | 311 | /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 312 | protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 313 | { |
| 314 | return new BenchmarkServiceClient(configuration); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 315 | } |
| 316 | } |
| 317 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 318 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 319 | /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 320 | public static grpc::ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 321 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 322 | return grpc::ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 323 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame] | 324 | .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 Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 328 | } |
| 329 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 330 | } |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 331 | public static partial class WorkerService |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 332 | { |
| 333 | static readonly string __ServiceName = "grpc.testing.WorkerService"; |
| 334 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 335 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 342 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 343 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 345 | __ServiceName, |
| 346 | "RunServer", |
| 347 | __Marshaller_ServerArgs, |
| 348 | __Marshaller_ServerStatus); |
| 349 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 350 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 352 | __ServiceName, |
| 353 | "RunClient", |
| 354 | __Marshaller_ClientArgs, |
| 355 | __Marshaller_ClientStatus); |
| 356 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 357 | 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 Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 359 | __ServiceName, |
| 360 | "CoreCount", |
| 361 | __Marshaller_CoreRequest, |
| 362 | __Marshaller_CoreResponse); |
| 363 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 364 | 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 Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 366 | __ServiceName, |
| 367 | "QuitWorker", |
| 368 | __Marshaller_Void, |
| 369 | __Marshaller_Void); |
| 370 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 371 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 372 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 373 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 374 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 375 | } |
| 376 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 377 | /// <summary>Base class for server-side implementations of WorkerService</summary> |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 378 | public abstract partial class WorkerServiceBase |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 379 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 380 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 381 | /// 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 387 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 388 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 392 | 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 Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 393 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 394 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 395 | } |
| 396 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 397 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 398 | /// 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 404 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 405 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 409 | 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 Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 410 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 411 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 412 | } |
| 413 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 414 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 415 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 416 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 417 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 420 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, grpc::ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 421 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 422 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 423 | } |
| 424 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 425 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 426 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 427 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 428 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 431 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, grpc::ServerCallContext context) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 432 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 433 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 434 | } |
| 435 | |
| 436 | } |
| 437 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 438 | /// <summary>Client for WorkerService</summary> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 439 | public partial class WorkerServiceClient : grpc::ClientBase<WorkerServiceClient> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 440 | { |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 441 | /// <summary>Creates a new client for WorkerService</summary> |
| 442 | /// <param name="channel">The channel to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 443 | public WorkerServiceClient(grpc::Channel channel) : base(channel) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 444 | { |
| 445 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 446 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 448 | public WorkerServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 449 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 450 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 451 | /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 452 | protected WorkerServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 453 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 454 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 455 | /// <summary>Protected constructor to allow creation of configured clients.</summary> |
| 456 | /// <param name="configuration">The client configuration.</param> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 457 | protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
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 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 461 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 462 | /// 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 468 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 469 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 473 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 474 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 475 | return RunServer(new grpc::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> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 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. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 484 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 485 | /// <param name="options">The options for the call.</param> |
| 486 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 487 | public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(grpc::CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 488 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 489 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 490 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 491 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 492 | /// 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 498 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 499 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 503 | 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 Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 504 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 505 | return RunClient(new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 506 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 507 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 508 | /// 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 Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 514 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 515 | /// <param name="options">The options for the call.</param> |
| 516 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 517 | public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(grpc::CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 518 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 519 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 520 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 521 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 522 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 523 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 524 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 529 | public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 530 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 531 | return CoreCount(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 532 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 533 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 534 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 535 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 536 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 539 | public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 540 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 541 | return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 542 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 543 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 544 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 545 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 546 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 551 | 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 Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 552 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 553 | return CoreCountAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 554 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 555 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 556 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 557 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 558 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 561 | public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, grpc::CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 562 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 563 | return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 564 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 565 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 566 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 567 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 568 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 573 | public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 574 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 575 | return QuitWorker(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 576 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 577 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 578 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 579 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 580 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 583 | public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, grpc::CallOptions options) |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 584 | { |
| 585 | return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); |
| 586 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 587 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 588 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 589 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 590 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 595 | 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 Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 596 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 597 | return QuitWorkerAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 598 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 599 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 600 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 601 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 602 | /// <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 Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 605 | public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, grpc::CallOptions options) |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 606 | { |
| 607 | return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); |
| 608 | } |
Jan Tattermusch | 10098d1 | 2016-10-06 13:15:12 +0200 | [diff] [blame] | 609 | /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 610 | protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 611 | { |
| 612 | return new WorkerServiceClient(configuration); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 613 | } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 614 | } |
| 615 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 616 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 617 | /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 618 | public static grpc::ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 619 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 620 | return grpc::ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 621 | .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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 627 | } |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame] | 628 | 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 Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 747 | } |
| 748 | #endregion |