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: |
Jan Tattermusch | 4d5c310 | 2017-06-07 10:23:56 +0200 | [diff] [blame] | 4 | // Copyright 2015 gRPC authors. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 5 | // |
Jan Tattermusch | 4d5c310 | 2017-06-07 10:23:56 +0200 | [diff] [blame] | 6 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | // you may not use this file except in compliance with the License. |
| 8 | // You may obtain a copy of the License at |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 9 | // |
Jan Tattermusch | 4d5c310 | 2017-06-07 10:23:56 +0200 | [diff] [blame] | 10 | // http://www.apache.org/licenses/LICENSE-2.0 |
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 | // Unless required by applicable law or agreed to in writing, software |
| 13 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | // See the License for the specific language governing permissions and |
| 16 | // limitations under the License. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 17 | // |
| 18 | // An integration test service that covers all the method signature permutations |
| 19 | // of unary/streaming requests/responses. |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 20 | #region Designer generated code |
| 21 | |
| 22 | using System; |
| 23 | using System.Threading; |
| 24 | using System.Threading.Tasks; |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 25 | using grpc = global::Grpc.Core; |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 26 | |
| 27 | namespace Grpc.Testing { |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 28 | public static partial class BenchmarkService |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 29 | { |
| 30 | static readonly string __ServiceName = "grpc.testing.BenchmarkService"; |
| 31 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 32 | 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); |
| 33 | 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] | 34 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 35 | 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>( |
| 36 | grpc::MethodType.Unary, |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 37 | __ServiceName, |
| 38 | "UnaryCall", |
| 39 | __Marshaller_SimpleRequest, |
| 40 | __Marshaller_SimpleResponse); |
| 41 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 42 | 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>( |
| 43 | grpc::MethodType.DuplexStreaming, |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 44 | __ServiceName, |
| 45 | "StreamingCall", |
| 46 | __Marshaller_SimpleRequest, |
| 47 | __Marshaller_SimpleResponse); |
| 48 | |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame^] | 49 | 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>( |
| 50 | grpc::MethodType.ClientStreaming, |
| 51 | __ServiceName, |
| 52 | "StreamingFromClient", |
| 53 | __Marshaller_SimpleRequest, |
| 54 | __Marshaller_SimpleResponse); |
| 55 | |
| 56 | 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>( |
| 57 | grpc::MethodType.ServerStreaming, |
| 58 | __ServiceName, |
| 59 | "StreamingFromServer", |
| 60 | __Marshaller_SimpleRequest, |
| 61 | __Marshaller_SimpleResponse); |
| 62 | |
| 63 | 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>( |
| 64 | grpc::MethodType.DuplexStreaming, |
| 65 | __ServiceName, |
| 66 | "StreamingBothWays", |
| 67 | __Marshaller_SimpleRequest, |
| 68 | __Marshaller_SimpleResponse); |
| 69 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 70 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 71 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 72 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 73 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 74 | } |
| 75 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 76 | /// <summary>Base class for server-side implementations of BenchmarkService</summary> |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 77 | public abstract partial class BenchmarkServiceBase |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 78 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 79 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 80 | /// One request followed by one response. |
| 81 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 82 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 83 | /// <param name="request">The request received from the client.</param> |
| 84 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 85 | /// <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] | 86 | 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] | 87 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 88 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 89 | } |
| 90 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 91 | /// <summary> |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame^] | 92 | /// Repeated sequence of one request followed by one response. |
| 93 | /// Should be called streaming ping-pong |
| 94 | /// The server returns the client payload as-is on each response |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 95 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 96 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 97 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 98 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 99 | /// <returns>A task indicating completion of the handler.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 100 | 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] | 101 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 102 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 103 | } |
| 104 | |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame^] | 105 | /// <summary> |
| 106 | /// Single-sided unbounded streaming from client to server |
| 107 | /// The server returns the client payload as-is once the client does WritesDone |
| 108 | /// </summary> |
| 109 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 110 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 111 | /// <returns>The response to send back to the client (wrapped by a task).</returns> |
| 112 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, grpc::ServerCallContext context) |
| 113 | { |
| 114 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
| 115 | } |
| 116 | |
| 117 | /// <summary> |
| 118 | /// Single-sided unbounded streaming from server to client |
| 119 | /// The server repeatedly returns the client payload as-is |
| 120 | /// </summary> |
| 121 | /// <param name="request">The request received from the client.</param> |
| 122 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 123 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 124 | /// <returns>A task indicating completion of the handler.</returns> |
| 125 | public virtual global::System.Threading.Tasks.Task StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, grpc::ServerCallContext context) |
| 126 | { |
| 127 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
| 128 | } |
| 129 | |
| 130 | /// <summary> |
| 131 | /// Two-sided unbounded streaming between server to client |
| 132 | /// Both sides send the content of their own choice to the other |
| 133 | /// </summary> |
| 134 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 135 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 136 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 137 | /// <returns>A task indicating completion of the handler.</returns> |
| 138 | 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) |
| 139 | { |
| 140 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
| 141 | } |
| 142 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 143 | } |
| 144 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 145 | /// <summary>Client for BenchmarkService</summary> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 146 | public partial class BenchmarkServiceClient : grpc::ClientBase<BenchmarkServiceClient> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 147 | { |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 148 | /// <summary>Creates a new client for BenchmarkService</summary> |
| 149 | /// <param name="channel">The channel to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 150 | public BenchmarkServiceClient(grpc::Channel channel) : base(channel) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 151 | { |
| 152 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 153 | /// <summary>Creates a new client for BenchmarkService that uses a custom <c>CallInvoker</c>.</summary> |
| 154 | /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 155 | public BenchmarkServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 156 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 157 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 158 | /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 159 | protected BenchmarkServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 160 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 161 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 162 | /// <summary>Protected constructor to allow creation of configured clients.</summary> |
| 163 | /// <param name="configuration">The client configuration.</param> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 164 | protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 165 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 166 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 167 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 168 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 169 | /// One request followed by one response. |
| 170 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 171 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 172 | /// <param name="request">The request to send to the server.</param> |
| 173 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 174 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 175 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 176 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 177 | 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] | 178 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 179 | return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
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> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 182 | /// One request followed by one response. |
| 183 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 184 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 185 | /// <param name="request">The request to send to the server.</param> |
| 186 | /// <param name="options">The options for the call.</param> |
| 187 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 188 | 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] | 189 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 190 | return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 191 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 192 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 193 | /// One request followed by one response. |
| 194 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 195 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 196 | /// <param name="request">The request to send to the server.</param> |
| 197 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 198 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 199 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 200 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 201 | 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] | 202 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 203 | return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 204 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 205 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 206 | /// One request followed by one response. |
| 207 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 208 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 209 | /// <param name="request">The request to send to the server.</param> |
| 210 | /// <param name="options">The options for the call.</param> |
| 211 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 212 | 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] | 213 | { |
| 214 | return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); |
| 215 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 216 | /// <summary> |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame^] | 217 | /// Repeated sequence of one request followed by one response. |
| 218 | /// Should be called streaming ping-pong |
| 219 | /// The server returns the client payload as-is on each response |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 220 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 221 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 222 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 223 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 224 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 225 | 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] | 226 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 227 | return StreamingCall(new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 228 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 229 | /// <summary> |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame^] | 230 | /// Repeated sequence of one request followed by one response. |
| 231 | /// Should be called streaming ping-pong |
| 232 | /// The server returns the client payload as-is on each response |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 233 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 234 | /// <param name="options">The options for the call.</param> |
| 235 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 236 | 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] | 237 | { |
| 238 | return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); |
| 239 | } |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame^] | 240 | /// <summary> |
| 241 | /// Single-sided unbounded streaming from client to server |
| 242 | /// The server returns the client payload as-is once the client does WritesDone |
| 243 | /// </summary> |
| 244 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 245 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 246 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 247 | /// <returns>The call object.</returns> |
| 248 | public virtual grpc::AsyncClientStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 249 | { |
| 250 | return StreamingFromClient(new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 251 | } |
| 252 | /// <summary> |
| 253 | /// Single-sided unbounded streaming from client to server |
| 254 | /// The server returns the client payload as-is once the client does WritesDone |
| 255 | /// </summary> |
| 256 | /// <param name="options">The options for the call.</param> |
| 257 | /// <returns>The call object.</returns> |
| 258 | public virtual grpc::AsyncClientStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingFromClient(grpc::CallOptions options) |
| 259 | { |
| 260 | return CallInvoker.AsyncClientStreamingCall(__Method_StreamingFromClient, null, options); |
| 261 | } |
| 262 | /// <summary> |
| 263 | /// Single-sided unbounded streaming from server to client |
| 264 | /// The server repeatedly returns the client payload as-is |
| 265 | /// </summary> |
| 266 | /// <param name="request">The request to send to the server.</param> |
| 267 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 268 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 269 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 270 | /// <returns>The call object.</returns> |
| 271 | 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)) |
| 272 | { |
| 273 | return StreamingFromServer(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 274 | } |
| 275 | /// <summary> |
| 276 | /// Single-sided unbounded streaming from server to client |
| 277 | /// The server repeatedly returns the client payload as-is |
| 278 | /// </summary> |
| 279 | /// <param name="request">The request to send to the server.</param> |
| 280 | /// <param name="options">The options for the call.</param> |
| 281 | /// <returns>The call object.</returns> |
| 282 | public virtual grpc::AsyncServerStreamingCall<global::Grpc.Testing.SimpleResponse> StreamingFromServer(global::Grpc.Testing.SimpleRequest request, grpc::CallOptions options) |
| 283 | { |
| 284 | return CallInvoker.AsyncServerStreamingCall(__Method_StreamingFromServer, null, options, request); |
| 285 | } |
| 286 | /// <summary> |
| 287 | /// Two-sided unbounded streaming between server to client |
| 288 | /// Both sides send the content of their own choice to the other |
| 289 | /// </summary> |
| 290 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 291 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 292 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 293 | /// <returns>The call object.</returns> |
| 294 | public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingBothWays(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 295 | { |
| 296 | return StreamingBothWays(new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 297 | } |
| 298 | /// <summary> |
| 299 | /// Two-sided unbounded streaming between server to client |
| 300 | /// Both sides send the content of their own choice to the other |
| 301 | /// </summary> |
| 302 | /// <param name="options">The options for the call.</param> |
| 303 | /// <returns>The call object.</returns> |
| 304 | public virtual grpc::AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingBothWays(grpc::CallOptions options) |
| 305 | { |
| 306 | return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingBothWays, null, options); |
| 307 | } |
Jan Tattermusch | 10098d1 | 2016-10-06 13:15:12 +0200 | [diff] [blame] | 308 | /// <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] | 309 | protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 310 | { |
| 311 | return new BenchmarkServiceClient(configuration); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 312 | } |
| 313 | } |
| 314 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 315 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 316 | /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 317 | public static grpc::ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 318 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 319 | return grpc::ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 320 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame^] | 321 | .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall) |
| 322 | .AddMethod(__Method_StreamingFromClient, serviceImpl.StreamingFromClient) |
| 323 | .AddMethod(__Method_StreamingFromServer, serviceImpl.StreamingFromServer) |
| 324 | .AddMethod(__Method_StreamingBothWays, serviceImpl.StreamingBothWays).Build(); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 325 | } |
| 326 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 327 | } |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 328 | public static partial class WorkerService |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 329 | { |
| 330 | static readonly string __ServiceName = "grpc.testing.WorkerService"; |
| 331 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 332 | 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); |
| 333 | 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); |
| 334 | 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); |
| 335 | 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); |
| 336 | 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); |
| 337 | 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); |
| 338 | 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] | 339 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 340 | 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>( |
| 341 | grpc::MethodType.DuplexStreaming, |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 342 | __ServiceName, |
| 343 | "RunServer", |
| 344 | __Marshaller_ServerArgs, |
| 345 | __Marshaller_ServerStatus); |
| 346 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 347 | 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>( |
| 348 | grpc::MethodType.DuplexStreaming, |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 349 | __ServiceName, |
| 350 | "RunClient", |
| 351 | __Marshaller_ClientArgs, |
| 352 | __Marshaller_ClientStatus); |
| 353 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 354 | 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>( |
| 355 | grpc::MethodType.Unary, |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 356 | __ServiceName, |
| 357 | "CoreCount", |
| 358 | __Marshaller_CoreRequest, |
| 359 | __Marshaller_CoreResponse); |
| 360 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 361 | 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>( |
| 362 | grpc::MethodType.Unary, |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 363 | __ServiceName, |
| 364 | "QuitWorker", |
| 365 | __Marshaller_Void, |
| 366 | __Marshaller_Void); |
| 367 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 368 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 369 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 370 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 371 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 372 | } |
| 373 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 374 | /// <summary>Base class for server-side implementations of WorkerService</summary> |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 375 | public abstract partial class WorkerServiceBase |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 376 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 377 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 378 | /// Start server with specified workload. |
| 379 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 380 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 381 | /// stats. Closing the stream will initiate shutdown of the test server |
| 382 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 383 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 384 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 385 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 386 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 387 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 388 | /// <returns>A task indicating completion of the handler.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 389 | 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] | 390 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 391 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 392 | } |
| 393 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 394 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 395 | /// Start client with specified workload. |
| 396 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 397 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 398 | /// stats. Closing the stream will initiate shutdown of the test client |
| 399 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 400 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 401 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 402 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 403 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 404 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 405 | /// <returns>A task indicating completion of the handler.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 406 | 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] | 407 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 408 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 409 | } |
| 410 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 411 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 412 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 413 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 414 | /// <param name="request">The request received from the client.</param> |
| 415 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 416 | /// <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] | 417 | 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] | 418 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 419 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 420 | } |
| 421 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 422 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 423 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 424 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 425 | /// <param name="request">The request received from the client.</param> |
| 426 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 427 | /// <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] | 428 | 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] | 429 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 430 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 431 | } |
| 432 | |
| 433 | } |
| 434 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 435 | /// <summary>Client for WorkerService</summary> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 436 | public partial class WorkerServiceClient : grpc::ClientBase<WorkerServiceClient> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 437 | { |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 438 | /// <summary>Creates a new client for WorkerService</summary> |
| 439 | /// <param name="channel">The channel to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 440 | public WorkerServiceClient(grpc::Channel channel) : base(channel) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 441 | { |
| 442 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 443 | /// <summary>Creates a new client for WorkerService that uses a custom <c>CallInvoker</c>.</summary> |
| 444 | /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 445 | public WorkerServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 446 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 447 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 448 | /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 449 | protected WorkerServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 450 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 451 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 452 | /// <summary>Protected constructor to allow creation of configured clients.</summary> |
| 453 | /// <param name="configuration">The client configuration.</param> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 454 | protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 455 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 456 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 457 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 458 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 459 | /// Start server with specified workload. |
| 460 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 461 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 462 | /// stats. Closing the stream will initiate shutdown of the test server |
| 463 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 464 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 465 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 466 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 467 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 468 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 469 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 470 | 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] | 471 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 472 | return RunServer(new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 473 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 474 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 475 | /// Start server with specified workload. |
| 476 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 477 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 478 | /// stats. Closing the stream will initiate shutdown of the test server |
| 479 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 480 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 481 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 482 | /// <param name="options">The options for the call.</param> |
| 483 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 484 | 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] | 485 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 486 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 487 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 488 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 489 | /// Start client with specified workload. |
| 490 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 491 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 492 | /// stats. Closing the stream will initiate shutdown of the test client |
| 493 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 494 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 495 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 496 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 497 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 498 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 499 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 500 | 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] | 501 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 502 | return RunClient(new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 503 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 504 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 505 | /// Start client with specified workload. |
| 506 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 507 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 508 | /// stats. Closing the stream will initiate shutdown of the test client |
| 509 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 510 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 511 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 512 | /// <param name="options">The options for the call.</param> |
| 513 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 514 | 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] | 515 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 516 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 517 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 518 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 519 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 520 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 521 | /// <param name="request">The request to send to the server.</param> |
| 522 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 523 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 524 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 525 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 526 | 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] | 527 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 528 | return CoreCount(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 529 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 530 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 531 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 532 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 533 | /// <param name="request">The request to send to the server.</param> |
| 534 | /// <param name="options">The options for the call.</param> |
| 535 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 536 | 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] | 537 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 538 | return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 539 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 540 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 541 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 542 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 543 | /// <param name="request">The request to send to the server.</param> |
| 544 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 545 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 546 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 547 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 548 | 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] | 549 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 550 | return CoreCountAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 551 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 552 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 553 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 554 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 555 | /// <param name="request">The request to send to the server.</param> |
| 556 | /// <param name="options">The options for the call.</param> |
| 557 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 558 | 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] | 559 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 560 | return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 561 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 562 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 563 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 564 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 565 | /// <param name="request">The request to send to the server.</param> |
| 566 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 567 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 568 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 569 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 570 | 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] | 571 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 572 | return QuitWorker(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 573 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 574 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 575 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 576 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 577 | /// <param name="request">The request to send to the server.</param> |
| 578 | /// <param name="options">The options for the call.</param> |
| 579 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 580 | 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] | 581 | { |
| 582 | return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); |
| 583 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 584 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 585 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 586 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 587 | /// <param name="request">The request to send to the server.</param> |
| 588 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 589 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 590 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 591 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 592 | 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] | 593 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 594 | return QuitWorkerAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 595 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 596 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 597 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 598 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 599 | /// <param name="request">The request to send to the server.</param> |
| 600 | /// <param name="options">The options for the call.</param> |
| 601 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 602 | 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] | 603 | { |
| 604 | return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); |
| 605 | } |
Jan Tattermusch | 10098d1 | 2016-10-06 13:15:12 +0200 | [diff] [blame] | 606 | /// <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] | 607 | protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 608 | { |
| 609 | return new WorkerServiceClient(configuration); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 610 | } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 611 | } |
| 612 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 613 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 614 | /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 615 | public static grpc::ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 616 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame] | 617 | return grpc::ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 618 | .AddMethod(__Method_RunServer, serviceImpl.RunServer) |
| 619 | .AddMethod(__Method_RunClient, serviceImpl.RunClient) |
| 620 | .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) |
| 621 | .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); |
| 622 | } |
| 623 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 624 | } |
Jan Tattermusch | eb0219b | 2017-06-27 17:04:04 +0200 | [diff] [blame^] | 625 | public static partial class ReportQpsScenarioService |
| 626 | { |
| 627 | static readonly string __ServiceName = "grpc.testing.ReportQpsScenarioService"; |
| 628 | |
| 629 | 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); |
| 630 | 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); |
| 631 | |
| 632 | 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>( |
| 633 | grpc::MethodType.Unary, |
| 634 | __ServiceName, |
| 635 | "ReportScenario", |
| 636 | __Marshaller_ScenarioResult, |
| 637 | __Marshaller_Void); |
| 638 | |
| 639 | /// <summary>Service descriptor</summary> |
| 640 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 641 | { |
| 642 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[2]; } |
| 643 | } |
| 644 | |
| 645 | /// <summary>Base class for server-side implementations of ReportQpsScenarioService</summary> |
| 646 | public abstract partial class ReportQpsScenarioServiceBase |
| 647 | { |
| 648 | /// <summary> |
| 649 | /// Report results of a QPS test benchmark scenario. |
| 650 | /// </summary> |
| 651 | /// <param name="request">The request received from the client.</param> |
| 652 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 653 | /// <returns>The response to send back to the client (wrapped by a task).</returns> |
| 654 | public virtual global::System.Threading.Tasks.Task<global::Grpc.Testing.Void> ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::ServerCallContext context) |
| 655 | { |
| 656 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
| 657 | } |
| 658 | |
| 659 | } |
| 660 | |
| 661 | /// <summary>Client for ReportQpsScenarioService</summary> |
| 662 | public partial class ReportQpsScenarioServiceClient : grpc::ClientBase<ReportQpsScenarioServiceClient> |
| 663 | { |
| 664 | /// <summary>Creates a new client for ReportQpsScenarioService</summary> |
| 665 | /// <param name="channel">The channel to use to make remote calls.</param> |
| 666 | public ReportQpsScenarioServiceClient(grpc::Channel channel) : base(channel) |
| 667 | { |
| 668 | } |
| 669 | /// <summary>Creates a new client for ReportQpsScenarioService that uses a custom <c>CallInvoker</c>.</summary> |
| 670 | /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> |
| 671 | public ReportQpsScenarioServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) |
| 672 | { |
| 673 | } |
| 674 | /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 675 | protected ReportQpsScenarioServiceClient() : base() |
| 676 | { |
| 677 | } |
| 678 | /// <summary>Protected constructor to allow creation of configured clients.</summary> |
| 679 | /// <param name="configuration">The client configuration.</param> |
| 680 | protected ReportQpsScenarioServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
| 681 | { |
| 682 | } |
| 683 | |
| 684 | /// <summary> |
| 685 | /// Report results of a QPS test benchmark scenario. |
| 686 | /// </summary> |
| 687 | /// <param name="request">The request to send to the server.</param> |
| 688 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 689 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 690 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 691 | /// <returns>The response received from the server.</returns> |
| 692 | public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 693 | { |
| 694 | return ReportScenario(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 695 | } |
| 696 | /// <summary> |
| 697 | /// Report results of a QPS test benchmark scenario. |
| 698 | /// </summary> |
| 699 | /// <param name="request">The request to send to the server.</param> |
| 700 | /// <param name="options">The options for the call.</param> |
| 701 | /// <returns>The response received from the server.</returns> |
| 702 | public virtual global::Grpc.Testing.Void ReportScenario(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options) |
| 703 | { |
| 704 | return CallInvoker.BlockingUnaryCall(__Method_ReportScenario, null, options, request); |
| 705 | } |
| 706 | /// <summary> |
| 707 | /// Report results of a QPS test benchmark scenario. |
| 708 | /// </summary> |
| 709 | /// <param name="request">The request to send to the server.</param> |
| 710 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 711 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 712 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 713 | /// <returns>The call object.</returns> |
| 714 | 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)) |
| 715 | { |
| 716 | return ReportScenarioAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
| 717 | } |
| 718 | /// <summary> |
| 719 | /// Report results of a QPS test benchmark scenario. |
| 720 | /// </summary> |
| 721 | /// <param name="request">The request to send to the server.</param> |
| 722 | /// <param name="options">The options for the call.</param> |
| 723 | /// <returns>The call object.</returns> |
| 724 | public virtual grpc::AsyncUnaryCall<global::Grpc.Testing.Void> ReportScenarioAsync(global::Grpc.Testing.ScenarioResult request, grpc::CallOptions options) |
| 725 | { |
| 726 | return CallInvoker.AsyncUnaryCall(__Method_ReportScenario, null, options, request); |
| 727 | } |
| 728 | /// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary> |
| 729 | protected override ReportQpsScenarioServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 730 | { |
| 731 | return new ReportQpsScenarioServiceClient(configuration); |
| 732 | } |
| 733 | } |
| 734 | |
| 735 | /// <summary>Creates service definition that can be registered with a server</summary> |
| 736 | /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> |
| 737 | public static grpc::ServerServiceDefinition BindService(ReportQpsScenarioServiceBase serviceImpl) |
| 738 | { |
| 739 | return grpc::ServerServiceDefinition.CreateBuilder() |
| 740 | .AddMethod(__Method_ReportScenario, serviceImpl.ReportScenario).Build(); |
| 741 | } |
| 742 | |
| 743 | } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 744 | } |
| 745 | #endregion |