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 | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 3 | #region Designer generated code |
| 4 | |
| 5 | using System; |
| 6 | using System.Threading; |
| 7 | using System.Threading.Tasks; |
| 8 | using Grpc.Core; |
| 9 | |
| 10 | namespace Grpc.Testing { |
| 11 | public static class BenchmarkService |
| 12 | { |
| 13 | static readonly string __ServiceName = "grpc.testing.BenchmarkService"; |
| 14 | |
| 15 | static readonly Marshaller<global::Grpc.Testing.SimpleRequest> __Marshaller_SimpleRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); |
| 16 | static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); |
| 17 | |
| 18 | static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_UnaryCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>( |
| 19 | MethodType.Unary, |
| 20 | __ServiceName, |
| 21 | "UnaryCall", |
| 22 | __Marshaller_SimpleRequest, |
| 23 | __Marshaller_SimpleResponse); |
| 24 | |
| 25 | static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> __Method_StreamingCall = new Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse>( |
| 26 | MethodType.DuplexStreaming, |
| 27 | __ServiceName, |
| 28 | "StreamingCall", |
| 29 | __Marshaller_SimpleRequest, |
| 30 | __Marshaller_SimpleResponse); |
| 31 | |
| 32 | // service descriptor |
| 33 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 34 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 35 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | // client interface |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 39 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 40 | public interface IBenchmarkServiceClient |
| 41 | { |
| 42 | global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 43 | global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options); |
| 44 | AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 45 | AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options); |
| 46 | AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 47 | AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options); |
| 48 | } |
| 49 | |
| 50 | // server-side interface |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 51 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 52 | public interface IBenchmarkService |
| 53 | { |
| 54 | Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); |
| 55 | Task StreamingCall(IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, ServerCallContext context); |
| 56 | } |
| 57 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 58 | // server-side abstract class |
| 59 | public abstract class BenchmarkServiceBase |
| 60 | { |
| 61 | public virtual Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) |
| 62 | { |
| 63 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 64 | } |
| 65 | |
| 66 | public virtual Task StreamingCall(IAsyncStreamReader<global::Grpc.Testing.SimpleRequest> requestStream, IServerStreamWriter<global::Grpc.Testing.SimpleResponse> responseStream, ServerCallContext context) |
| 67 | { |
| 68 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 69 | } |
| 70 | |
| 71 | } |
| 72 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 73 | // client stub |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 74 | public class BenchmarkServiceClient : ClientBase<BenchmarkServiceClient>, IBenchmarkServiceClient |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 75 | { |
| 76 | public BenchmarkServiceClient(Channel channel) : base(channel) |
| 77 | { |
| 78 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 79 | public BenchmarkServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 80 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 81 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 82 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 83 | protected BenchmarkServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 84 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 85 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 86 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 87 | protected BenchmarkServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 88 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 89 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 90 | |
| 91 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 92 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 93 | return UnaryCall(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 94 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 95 | public virtual global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 96 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 97 | return CallInvoker.BlockingUnaryCall(__Method_UnaryCall, null, options, request); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 98 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 99 | public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 100 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 101 | return UnaryCallAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 102 | } |
| 103 | public virtual AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global::Grpc.Testing.SimpleRequest request, CallOptions options) |
| 104 | { |
| 105 | return CallInvoker.AsyncUnaryCall(__Method_UnaryCall, null, options, request); |
| 106 | } |
| 107 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 108 | { |
| 109 | return StreamingCall(new CallOptions(headers, deadline, cancellationToken)); |
| 110 | } |
| 111 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options) |
| 112 | { |
| 113 | return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); |
| 114 | } |
| 115 | protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 116 | { |
| 117 | return new BenchmarkServiceClient(configuration); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 118 | } |
| 119 | } |
| 120 | |
| 121 | // creates service definition that can be registered with a server |
| 122 | public static ServerServiceDefinition BindService(IBenchmarkService serviceImpl) |
| 123 | { |
| 124 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 125 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 126 | .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build(); |
| 127 | } |
| 128 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 129 | // creates service definition that can be registered with a server |
| 130 | public static ServerServiceDefinition BindService(BenchmarkServiceBase serviceImpl) |
| 131 | { |
| 132 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 133 | .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 134 | .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build(); |
| 135 | } |
| 136 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 137 | // creates a new client |
| 138 | public static BenchmarkServiceClient NewClient(Channel channel) |
| 139 | { |
| 140 | return new BenchmarkServiceClient(channel); |
| 141 | } |
| 142 | |
| 143 | } |
| 144 | public static class WorkerService |
| 145 | { |
| 146 | static readonly string __ServiceName = "grpc.testing.WorkerService"; |
| 147 | |
| 148 | static readonly Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_ServerArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom); |
| 149 | static readonly Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_ServerStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom); |
| 150 | static readonly Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_ClientArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom); |
| 151 | static readonly Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_ClientStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 152 | static readonly Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_CoreRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom); |
| 153 | static readonly Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_CoreResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom); |
| 154 | static readonly Marshaller<global::Grpc.Testing.Void> __Marshaller_Void = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Grpc.Testing.Void.Parser.ParseFrom); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 155 | |
| 156 | static readonly Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> __Method_RunServer = new Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus>( |
| 157 | MethodType.DuplexStreaming, |
| 158 | __ServiceName, |
| 159 | "RunServer", |
| 160 | __Marshaller_ServerArgs, |
| 161 | __Marshaller_ServerStatus); |
| 162 | |
| 163 | static readonly Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> __Method_RunClient = new Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus>( |
| 164 | MethodType.DuplexStreaming, |
| 165 | __ServiceName, |
| 166 | "RunClient", |
| 167 | __Marshaller_ClientArgs, |
| 168 | __Marshaller_ClientStatus); |
| 169 | |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 170 | static readonly Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse> __Method_CoreCount = new Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testing.CoreResponse>( |
| 171 | MethodType.Unary, |
| 172 | __ServiceName, |
| 173 | "CoreCount", |
| 174 | __Marshaller_CoreRequest, |
| 175 | __Marshaller_CoreResponse); |
| 176 | |
| 177 | static readonly Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void> __Method_QuitWorker = new Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void>( |
| 178 | MethodType.Unary, |
| 179 | __ServiceName, |
| 180 | "QuitWorker", |
| 181 | __Marshaller_Void, |
| 182 | __Marshaller_Void); |
| 183 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 184 | // service descriptor |
| 185 | public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor |
| 186 | { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame] | 187 | get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1]; } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | // client interface |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 191 | [System.Obsolete("Client side interfaced will be removed in the next release. Use client class directly.")] |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 192 | public interface IWorkerServiceClient |
| 193 | { |
| 194 | AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 195 | AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options); |
| 196 | AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 197 | AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 198 | global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 199 | global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options); |
| 200 | AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 201 | AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options); |
| 202 | global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 203 | global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options); |
| 204 | AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 205 | AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | // server-side interface |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 209 | [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 210 | public interface IWorkerService |
| 211 | { |
| 212 | Task RunServer(IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, ServerCallContext context); |
| 213 | Task RunClient(IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, ServerCallContext context); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 214 | Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context); |
| 215 | Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 216 | } |
| 217 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 218 | // server-side abstract class |
| 219 | public abstract class WorkerServiceBase |
| 220 | { |
| 221 | public virtual Task RunServer(IAsyncStreamReader<global::Grpc.Testing.ServerArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, ServerCallContext context) |
| 222 | { |
| 223 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 224 | } |
| 225 | |
| 226 | public virtual Task RunClient(IAsyncStreamReader<global::Grpc.Testing.ClientArgs> requestStream, IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, ServerCallContext context) |
| 227 | { |
| 228 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 229 | } |
| 230 | |
| 231 | public virtual Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context) |
| 232 | { |
| 233 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 234 | } |
| 235 | |
| 236 | public virtual Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context) |
| 237 | { |
| 238 | throw new RpcException(new Status(StatusCode.Unimplemented, "")); |
| 239 | } |
| 240 | |
| 241 | } |
| 242 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 243 | // client stub |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 244 | public class WorkerServiceClient : ClientBase<WorkerServiceClient>, IWorkerServiceClient |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 245 | { |
| 246 | public WorkerServiceClient(Channel channel) : base(channel) |
| 247 | { |
| 248 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 249 | public WorkerServiceClient(CallInvoker callInvoker) : base(callInvoker) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 250 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 251 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 252 | ///<summary>Protected parameterless constructor to allow creation of test doubles.</summary> |
| 253 | protected WorkerServiceClient() : base() |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 254 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 255 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 256 | ///<summary>Protected constructor to allow creation of configured clients.</summary> |
| 257 | protected WorkerServiceClient(ClientBaseConfiguration configuration) : base(configuration) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 258 | { |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 259 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 260 | |
| 261 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 262 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 263 | return RunServer(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 264 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 265 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Testing.ServerStatus> RunServer(CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 266 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 267 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunServer, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 268 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 269 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 270 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 271 | return RunClient(new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 272 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 273 | public virtual AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Testing.ClientStatus> RunClient(CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 274 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 275 | return CallInvoker.AsyncDuplexStreamingCall(__Method_RunClient, null, options); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 276 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 277 | public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 278 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 279 | return CoreCount(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 280 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 281 | public virtual global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreRequest request, CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 282 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 283 | return CallInvoker.BlockingUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 284 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 285 | public virtual AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 286 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 287 | return CoreCountAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 288 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 289 | public virtual AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::Grpc.Testing.CoreRequest request, CallOptions options) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 290 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 291 | return CallInvoker.AsyncUnaryCall(__Method_CoreCount, null, options, request); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 292 | } |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 293 | public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 294 | { |
Jan Tattermusch | ddc4e34 | 2016-03-21 19:03:14 -0700 | [diff] [blame^] | 295 | return QuitWorker(request, new CallOptions(headers, deadline, cancellationToken)); |
| 296 | } |
| 297 | public virtual global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, CallOptions options) |
| 298 | { |
| 299 | return CallInvoker.BlockingUnaryCall(__Method_QuitWorker, null, options, request); |
| 300 | } |
| 301 | public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 302 | { |
| 303 | return QuitWorkerAsync(request, new CallOptions(headers, deadline, cancellationToken)); |
| 304 | } |
| 305 | public virtual AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Testing.Void request, CallOptions options) |
| 306 | { |
| 307 | return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); |
| 308 | } |
| 309 | protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration) |
| 310 | { |
| 311 | return new WorkerServiceClient(configuration); |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 312 | } |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 313 | } |
| 314 | |
| 315 | // creates service definition that can be registered with a server |
| 316 | public static ServerServiceDefinition BindService(IWorkerService serviceImpl) |
| 317 | { |
| 318 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 319 | .AddMethod(__Method_RunServer, serviceImpl.RunServer) |
Jan Tattermusch | 1cbb567 | 2016-02-18 14:27:28 -0800 | [diff] [blame] | 320 | .AddMethod(__Method_RunClient, serviceImpl.RunClient) |
| 321 | .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) |
| 322 | .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 323 | } |
| 324 | |
Jan Tattermusch | eeef5ed | 2016-03-14 16:08:39 -0700 | [diff] [blame] | 325 | // creates service definition that can be registered with a server |
| 326 | public static ServerServiceDefinition BindService(WorkerServiceBase serviceImpl) |
| 327 | { |
| 328 | return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 329 | .AddMethod(__Method_RunServer, serviceImpl.RunServer) |
| 330 | .AddMethod(__Method_RunClient, serviceImpl.RunClient) |
| 331 | .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) |
| 332 | .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); |
| 333 | } |
| 334 | |
Jan Tattermusch | d0c1bfa | 2015-10-22 19:14:57 -0700 | [diff] [blame] | 335 | // creates a new client |
| 336 | public static WorkerServiceClient NewClient(Channel channel) |
| 337 | { |
| 338 | return new WorkerServiceClient(channel); |
| 339 | } |
| 340 | |
| 341 | } |
| 342 | } |
| 343 | #endregion |