Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 2 | // source: src/proto/grpc/testing/services.proto |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 3 | // Original file comments: |
| 4 | // Copyright 2015, Google Inc. |
| 5 | // All rights reserved. |
| 6 | // |
| 7 | // Redistribution and use in source and binary forms, with or without |
| 8 | // modification, are permitted provided that the following conditions are |
| 9 | // met: |
| 10 | // |
| 11 | // * Redistributions of source code must retain the above copyright |
| 12 | // notice, this list of conditions and the following disclaimer. |
| 13 | // * Redistributions in binary form must reproduce the above |
| 14 | // copyright notice, this list of conditions and the following disclaimer |
| 15 | // in the documentation and/or other materials provided with the |
| 16 | // distribution. |
| 17 | // * Neither the name of Google Inc. nor the names of its |
| 18 | // contributors may be used to endorse or promote products derived from |
| 19 | // this software without specific prior written permission. |
| 20 | // |
| 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 24 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 25 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 26 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 27 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 28 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 29 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 30 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 31 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | // |
| 33 | // An integration test service that covers all the method signature permutations |
| 34 | // of unary/streaming requests/responses. |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 35 | #region Designer generated code |
| 36 | |
| 37 | using System; |
| 38 | using System.Threading; |
| 39 | using System.Threading.Tasks; |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 40 | using grpc = global::Grpc.Core; |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 41 | |
| 42 | namespace Grpc.Testing { |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 43 | public static partial class BenchmarkService |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 44 | { |
| 45 | static readonly string __ServiceName = "grpc.testing.BenchmarkService"; |
| 46 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 47 | 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); |
| 48 | 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] | 49 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 50 | 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>( |
| 51 | grpc::MethodType.Unary, |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 52 | __ServiceName, |
| 53 | "UnaryCall", |
| 54 | __Marshaller_SimpleRequest, |
| 55 | __Marshaller_SimpleResponse); |
| 56 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 57 | 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>( |
| 58 | grpc::MethodType.DuplexStreaming, |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 59 | __ServiceName, |
| 60 | "StreamingCall", |
| 61 | __Marshaller_SimpleRequest, |
| 62 | __Marshaller_SimpleResponse); |
| 63 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 64 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 65 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 66 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 67 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 68 | } |
| 69 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 70 | /// <summary>Base class for server-side implementations of BenchmarkService</summary> |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 71 | public abstract partial class BenchmarkServiceBase |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 72 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 73 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 74 | /// One request followed by one response. |
| 75 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 76 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 77 | /// <param name="request">The request received from the client.</param> |
| 78 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 79 | /// <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^] | 80 | 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] | 81 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 82 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 83 | } |
| 84 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 85 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 86 | /// One request followed by one response. |
| 87 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 88 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 89 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 90 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 91 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 92 | /// <returns>A task indicating completion of the handler.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 93 | 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] | 94 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 95 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | } |
| 99 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 100 | /// <summary>Client for BenchmarkService</summary> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 101 | public partial class BenchmarkServiceClient : grpc::ClientBase<BenchmarkServiceClient> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 102 | { |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 103 | /// <summary>Creates a new client for BenchmarkService</summary> |
| 104 | /// <param name="channel">The channel to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 105 | public BenchmarkServiceClient(grpc::Channel channel) : base(channel) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 106 | { |
| 107 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 108 | /// <summary>Creates a new client for BenchmarkService that uses a custom <c>CallInvoker</c>.</summary> |
| 109 | /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 110 | public BenchmarkServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 111 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 112 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 113 | /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 114 | protected BenchmarkServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 115 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 116 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 117 | /// <summary>Protected constructor to allow creation of configured clients.</summary> |
| 118 | /// <param name="configuration">The client configuration.</param> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 119 | protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 120 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 121 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 122 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 123 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 124 | /// One request followed by one response. |
| 125 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 126 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 127 | /// <param name="request">The request to send to the server.</param> |
| 128 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 129 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 130 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 131 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 132 | 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] | 133 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 134 | return UnaryCall(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 135 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 136 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 137 | /// One request followed by one response. |
| 138 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 139 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 140 | /// <param name="request">The request to send to the server.</param> |
| 141 | /// <param name="options">The options for the call.</param> |
| 142 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 143 | 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] | 144 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 145 | return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 146 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 147 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 148 | /// One request followed by one response. |
| 149 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 150 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 151 | /// <param name="request">The request to send to the server.</param> |
| 152 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 153 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 154 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 155 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 156 | 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] | 157 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 158 | return UnaryCallAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 159 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 160 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 161 | /// One request followed by one response. |
| 162 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 163 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 164 | /// <param name="request">The request to send to the server.</param> |
| 165 | /// <param name="options">The options for the call.</param> |
| 166 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 167 | 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] | 168 | { |
| 169 | return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); |
| 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="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 176 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 177 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 178 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 179 | 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] | 180 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 181 | return StreamingCall(new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 182 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 183 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 184 | /// One request followed by one response. |
| 185 | /// The server returns the client payload as-is. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 186 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 187 | /// <param name="options">The options for the call.</param> |
| 188 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 189 | 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] | 190 | { |
| 191 | return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); |
| 192 | } |
Jan Tattermusch | 10098d1 | 2016-10-06 13:15:12 +0200 | [diff] [blame] | 193 | /// <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] | 194 | protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 195 | { |
| 196 | return new BenchmarkServiceClient(configuration); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 197 | } |
| 198 | } |
| 199 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 200 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 201 | /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 202 | public static grpc::ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 203 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 204 | return grpc::ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 205 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 206 | .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build(); |
| 207 | } |
| 208 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 209 | } |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 210 | public static partial class WorkerService |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 211 | { |
| 212 | static readonly string __ServiceName = "grpc.testing.WorkerService"; |
| 213 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 214 | 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); |
| 215 | 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); |
| 216 | 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); |
| 217 | 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); |
| 218 | 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); |
| 219 | 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); |
| 220 | 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] | 221 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 222 | 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>( |
| 223 | grpc::MethodType.DuplexStreaming, |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 224 | __ServiceName, |
| 225 | "RunServer", |
| 226 | __Marshaller_ServerArgs, |
| 227 | __Marshaller_ServerStatus); |
| 228 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 229 | 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>( |
| 230 | grpc::MethodType.DuplexStreaming, |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 231 | __ServiceName, |
| 232 | "RunClient", |
| 233 | __Marshaller_ClientArgs, |
| 234 | __Marshaller_ClientStatus); |
| 235 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 236 | 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>( |
| 237 | grpc::MethodType.Unary, |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 238 | __ServiceName, |
| 239 | "CoreCount", |
| 240 | __Marshaller_CoreRequest, |
| 241 | __Marshaller_CoreResponse); |
| 242 | |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 243 | 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>( |
| 244 | grpc::MethodType.Unary, |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 245 | __ServiceName, |
| 246 | "QuitWorker", |
| 247 | __Marshaller_Void, |
| 248 | __Marshaller_Void); |
| 249 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 250 | /// <summary>Service descriptor</summary> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 251 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 252 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 253 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 254 | } |
| 255 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 256 | /// <summary>Base class for server-side implementations of WorkerService</summary> |
Alexander Polcyn | c0f4c2c | 2016-11-07 10:24:35 -0800 | [diff] [blame] | 257 | public abstract partial class WorkerServiceBase |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 258 | { |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 259 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 260 | /// Start server with specified workload. |
| 261 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 262 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 263 | /// stats. Closing the stream will initiate shutdown of the test server |
| 264 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 265 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 266 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 267 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 268 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 269 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 270 | /// <returns>A task indicating completion of the handler.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 271 | 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] | 272 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 273 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 274 | } |
| 275 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 276 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 277 | /// Start client with specified workload. |
| 278 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 279 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 280 | /// stats. Closing the stream will initiate shutdown of the test client |
| 281 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 282 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 283 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 284 | /// <param name="requestStream">Used for reading requests from the client.</param> |
| 285 | /// <param name="responseStream">Used for sending responses back to the client.</param> |
| 286 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 287 | /// <returns>A task indicating completion of the handler.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 288 | 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] | 289 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 290 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 291 | } |
| 292 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 293 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 294 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 295 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 296 | /// <param name="request">The request received from the client.</param> |
| 297 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 298 | /// <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^] | 299 | 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] | 300 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 301 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 302 | } |
| 303 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 304 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 305 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 306 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 307 | /// <param name="request">The request received from the client.</param> |
| 308 | /// <param name="context">The context of the server-side call handler being invoked.</param> |
| 309 | /// <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^] | 310 | 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] | 311 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 312 | throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | } |
| 316 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 317 | /// <summary>Client for WorkerService</summary> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 318 | public partial class WorkerServiceClient : grpc::ClientBase<WorkerServiceClient> |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 319 | { |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 320 | /// <summary>Creates a new client for WorkerService</summary> |
| 321 | /// <param name="channel">The channel to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 322 | public WorkerServiceClient(grpc::Channel channel) : base(channel) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 323 | { |
| 324 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 325 | /// <summary>Creates a new client for WorkerService that uses a custom <c>CallInvoker</c>.</summary> |
| 326 | /// <param name="callInvoker">The callInvoker to use to make remote calls.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 327 | public WorkerServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 328 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 329 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 330 | /// <summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 331 | protected WorkerServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 332 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 333 | } |
Jan Tattermusch | ed6ea4c | 2016-06-22 12:38:44 -0700 | [diff] [blame] | 334 | /// <summary>Protected constructor to allow creation of configured clients.</summary> |
| 335 | /// <param name="configuration">The client configuration.</param> |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 336 | protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 337 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 338 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 339 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 340 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 341 | /// Start server with specified workload. |
| 342 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 343 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 344 | /// stats. Closing the stream will initiate shutdown of the test server |
| 345 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 346 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 347 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 348 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 349 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 350 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 351 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 352 | 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] | 353 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 354 | return RunServer(new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 355 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 356 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 357 | /// Start server with specified workload. |
| 358 | /// First request sent specifies the ServerConfig followed by ServerStatus |
| 359 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 360 | /// stats. Closing the stream will initiate shutdown of the test server |
| 361 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 362 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 363 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 364 | /// <param name="options">The options for the call.</param> |
| 365 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 366 | 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] | 367 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 368 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 369 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 370 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 371 | /// Start client with specified workload. |
| 372 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 373 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 374 | /// stats. Closing the stream will initiate shutdown of the test client |
| 375 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 376 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 377 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 378 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 379 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 380 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 381 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 382 | 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] | 383 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 384 | return RunClient(new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 385 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 386 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 387 | /// Start client with specified workload. |
| 388 | /// First request sent specifies the ClientConfig followed by ClientStatus |
| 389 | /// response. After that, a "Mark" can be sent anytime to request the latest |
| 390 | /// stats. Closing the stream will initiate shutdown of the test client |
| 391 | /// and once the shutdown has finished, the OK status is sent to terminate |
| 392 | /// this RPC. |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 393 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 394 | /// <param name="options">The options for the call.</param> |
| 395 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 396 | 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] | 397 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 398 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 399 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 400 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 401 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 402 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 403 | /// <param name="request">The request to send to the server.</param> |
| 404 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 405 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 406 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 407 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 408 | 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] | 409 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 410 | return CoreCount(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 411 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 412 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 413 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 414 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 415 | /// <param name="request">The request to send to the server.</param> |
| 416 | /// <param name="options">The options for the call.</param> |
| 417 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 418 | 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] | 419 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 420 | return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 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 | /// Just return the core count - unary call |
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 to send to the server.</param> |
| 426 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 427 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 428 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 429 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 430 | 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] | 431 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 432 | return CoreCountAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 433 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 434 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 435 | /// Just return the core count - unary call |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 436 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 437 | /// <param name="request">The request to send to the server.</param> |
| 438 | /// <param name="options">The options for the call.</param> |
| 439 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 440 | 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] | 441 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 442 | return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 443 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 444 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 445 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 446 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 447 | /// <param name="request">The request to send to the server.</param> |
| 448 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 449 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 450 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 451 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 452 | 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] | 453 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 454 | return QuitWorker(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 455 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 456 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 457 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 458 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 459 | /// <param name="request">The request to send to the server.</param> |
| 460 | /// <param name="options">The options for the call.</param> |
| 461 | /// <returns>The response received from the server.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 462 | 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] | 463 | { |
| 464 | return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); |
| 465 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 466 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 467 | /// Quit this worker |
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="request">The request to send to the server.</param> |
| 470 | /// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param> |
| 471 | /// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param> |
| 472 | /// <param name="cancellationToken">An optional token for canceling the call.</param> |
| 473 | /// <returns>The call object.</returns> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 474 | 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] | 475 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 476 | return QuitWorkerAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame] | 477 | } |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 478 | /// <summary> |
Jan Tattermusch | 726f40f | 2016-12-12 12:09:35 +0100 | [diff] [blame] | 479 | /// Quit this worker |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 480 | /// </summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 481 | /// <param name="request">The request to send to the server.</param> |
| 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::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] | 485 | { |
| 486 | return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); |
| 487 | } |
Jan Tattermusch | 10098d1 | 2016-10-06 13:15:12 +0200 | [diff] [blame] | 488 | /// <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] | 489 | protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 490 | { |
| 491 | return new WorkerServiceClient(configuration); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 492 | } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 493 | } |
| 494 | |
Jan Tattermusch | bfee01d | 2016-04-28 10:52:41 -0700 | [diff] [blame] | 495 | /// <summary>Creates service definition that can be registered with a server</summary> |
Jan Tattermusch | 00f6636 | 2016-12-12 13:02:29 +0100 | [diff] [blame] | 496 | /// <param name="serviceImpl">An object implementing the server-side handling logic.</param> |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 497 | public static grpc::ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 498 | { |
Jan Tattermusch | ff4fc13 | 2017-03-14 09:27:50 +0100 | [diff] [blame^] | 499 | return grpc::ServerServiceDefinition.CreateBuilder() |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 500 | .AddMethod(__Method_RunServer, serviceImpl.RunServer) |
| 501 | .AddMethod(__Method_RunClient, serviceImpl.RunClient) |
| 502 | .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) |
| 503 | .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); |
| 504 | } |
| 505 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 506 | } |
| 507 | } |
| 508 | #endregion |