OLD | NEW |
(Empty) | |
| 1 // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 // source: src/proto/grpc/testing/services.proto |
| 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.MessageExten
sions.ToByteArray(arg), global::Grpc.Testing.SimpleRequest.Parser.ParseFrom); |
| 16 static readonly Marshaller<global::Grpc.Testing.SimpleResponse> __Marshaller
_SimpleResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExt
ensions.ToByteArray(arg), global::Grpc.Testing.SimpleResponse.Parser.ParseFrom); |
| 17 |
| 18 static readonly Method<global::Grpc.Testing.SimpleRequest, global::Grpc.Test
ing.SimpleResponse> __Method_UnaryCall = new Method<global::Grpc.Testing.SimpleR
equest, 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.Test
ing.SimpleResponse> __Method_StreamingCall = new Method<global::Grpc.Testing.Sim
pleRequest, 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 Descripto
r |
| 34 { |
| 35 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[0
]; } |
| 36 } |
| 37 |
| 38 // client interface |
| 39 public interface IBenchmarkServiceClient |
| 40 { |
| 41 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleR
equest request, Metadata headers = null, DateTime? deadline = null, Cancellation
Token cancellationToken = default(CancellationToken)); |
| 42 global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.SimpleR
equest request, CallOptions options); |
| 43 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global:
:Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? deadline
= null, CancellationToken cancellationToken = default(CancellationToken)); |
| 44 AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(global:
:Grpc.Testing.SimpleRequest request, CallOptions options); |
| 45 AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.
Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime? deadlin
e = null, CancellationToken cancellationToken = default(CancellationToken)); |
| 46 AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global::Grpc.
Testing.SimpleResponse> StreamingCall(CallOptions options); |
| 47 } |
| 48 |
| 49 // server-side interface |
| 50 public interface IBenchmarkService |
| 51 { |
| 52 Task<global::Grpc.Testing.SimpleResponse> UnaryCall(global::Grpc.Testing.S
impleRequest request, ServerCallContext context); |
| 53 Task StreamingCall(IAsyncStreamReader<global::Grpc.Testing.SimpleRequest>
requestStream, IServerStreamWriter<global::Grpc.Testing.SimpleResponse> response
Stream, ServerCallContext context); |
| 54 } |
| 55 |
| 56 // client stub |
| 57 public class BenchmarkServiceClient : ClientBase, IBenchmarkServiceClient |
| 58 { |
| 59 public BenchmarkServiceClient(Channel channel) : base(channel) |
| 60 { |
| 61 } |
| 62 public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.
SimpleRequest request, Metadata headers = null, DateTime? deadline = null, Cance
llationToken cancellationToken = default(CancellationToken)) |
| 63 { |
| 64 var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 65 return Calls.BlockingUnaryCall(call, request); |
| 66 } |
| 67 public global::Grpc.Testing.SimpleResponse UnaryCall(global::Grpc.Testing.
SimpleRequest request, CallOptions options) |
| 68 { |
| 69 var call = CreateCall(__Method_UnaryCall, options); |
| 70 return Calls.BlockingUnaryCall(call, request); |
| 71 } |
| 72 public AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(
global::Grpc.Testing.SimpleRequest request, Metadata headers = null, DateTime? d
eadline = null, CancellationToken cancellationToken = default(CancellationToken)
) |
| 73 { |
| 74 var call = CreateCall(__Method_UnaryCall, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 75 return Calls.AsyncUnaryCall(call, request); |
| 76 } |
| 77 public AsyncUnaryCall<global::Grpc.Testing.SimpleResponse> UnaryCallAsync(
global::Grpc.Testing.SimpleRequest request, CallOptions options) |
| 78 { |
| 79 var call = CreateCall(__Method_UnaryCall, options); |
| 80 return Calls.AsyncUnaryCall(call, request); |
| 81 } |
| 82 public AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global
::Grpc.Testing.SimpleResponse> StreamingCall(Metadata headers = null, DateTime?
deadline = null, CancellationToken cancellationToken = default(CancellationToken
)) |
| 83 { |
| 84 var call = CreateCall(__Method_StreamingCall, new CallOptions(headers, d
eadline, cancellationToken)); |
| 85 return Calls.AsyncDuplexStreamingCall(call); |
| 86 } |
| 87 public AsyncDuplexStreamingCall<global::Grpc.Testing.SimpleRequest, global
::Grpc.Testing.SimpleResponse> StreamingCall(CallOptions options) |
| 88 { |
| 89 var call = CreateCall(__Method_StreamingCall, options); |
| 90 return Calls.AsyncDuplexStreamingCall(call); |
| 91 } |
| 92 } |
| 93 |
| 94 // creates service definition that can be registered with a server |
| 95 public static ServerServiceDefinition BindService(IBenchmarkService serviceI
mpl) |
| 96 { |
| 97 return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 98 .AddMethod(__Method_UnaryCall, serviceImpl.UnaryCall) |
| 99 .AddMethod(__Method_StreamingCall, serviceImpl.StreamingCall).Build(); |
| 100 } |
| 101 |
| 102 // creates a new client |
| 103 public static BenchmarkServiceClient NewClient(Channel channel) |
| 104 { |
| 105 return new BenchmarkServiceClient(channel); |
| 106 } |
| 107 |
| 108 } |
| 109 public static class WorkerService |
| 110 { |
| 111 static readonly string __ServiceName = "grpc.testing.WorkerService"; |
| 112 |
| 113 static readonly Marshaller<global::Grpc.Testing.ServerArgs> __Marshaller_Ser
verArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.
ToByteArray(arg), global::Grpc.Testing.ServerArgs.Parser.ParseFrom); |
| 114 static readonly Marshaller<global::Grpc.Testing.ServerStatus> __Marshaller_S
erverStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensi
ons.ToByteArray(arg), global::Grpc.Testing.ServerStatus.Parser.ParseFrom); |
| 115 static readonly Marshaller<global::Grpc.Testing.ClientArgs> __Marshaller_Cli
entArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.
ToByteArray(arg), global::Grpc.Testing.ClientArgs.Parser.ParseFrom); |
| 116 static readonly Marshaller<global::Grpc.Testing.ClientStatus> __Marshaller_C
lientStatus = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensi
ons.ToByteArray(arg), global::Grpc.Testing.ClientStatus.Parser.ParseFrom); |
| 117 static readonly Marshaller<global::Grpc.Testing.CoreRequest> __Marshaller_Co
reRequest = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtension
s.ToByteArray(arg), global::Grpc.Testing.CoreRequest.Parser.ParseFrom); |
| 118 static readonly Marshaller<global::Grpc.Testing.CoreResponse> __Marshaller_C
oreResponse = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensi
ons.ToByteArray(arg), global::Grpc.Testing.CoreResponse.Parser.ParseFrom); |
| 119 static readonly Marshaller<global::Grpc.Testing.Void> __Marshaller_Void = Ma
rshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(
arg), global::Grpc.Testing.Void.Parser.ParseFrom); |
| 120 |
| 121 static readonly Method<global::Grpc.Testing.ServerArgs, global::Grpc.Testing
.ServerStatus> __Method_RunServer = new Method<global::Grpc.Testing.ServerArgs,
global::Grpc.Testing.ServerStatus>( |
| 122 MethodType.DuplexStreaming, |
| 123 __ServiceName, |
| 124 "RunServer", |
| 125 __Marshaller_ServerArgs, |
| 126 __Marshaller_ServerStatus); |
| 127 |
| 128 static readonly Method<global::Grpc.Testing.ClientArgs, global::Grpc.Testing
.ClientStatus> __Method_RunClient = new Method<global::Grpc.Testing.ClientArgs,
global::Grpc.Testing.ClientStatus>( |
| 129 MethodType.DuplexStreaming, |
| 130 __ServiceName, |
| 131 "RunClient", |
| 132 __Marshaller_ClientArgs, |
| 133 __Marshaller_ClientStatus); |
| 134 |
| 135 static readonly Method<global::Grpc.Testing.CoreRequest, global::Grpc.Testin
g.CoreResponse> __Method_CoreCount = new Method<global::Grpc.Testing.CoreRequest
, global::Grpc.Testing.CoreResponse>( |
| 136 MethodType.Unary, |
| 137 __ServiceName, |
| 138 "CoreCount", |
| 139 __Marshaller_CoreRequest, |
| 140 __Marshaller_CoreResponse); |
| 141 |
| 142 static readonly Method<global::Grpc.Testing.Void, global::Grpc.Testing.Void>
__Method_QuitWorker = new Method<global::Grpc.Testing.Void, global::Grpc.Testin
g.Void>( |
| 143 MethodType.Unary, |
| 144 __ServiceName, |
| 145 "QuitWorker", |
| 146 __Marshaller_Void, |
| 147 __Marshaller_Void); |
| 148 |
| 149 // service descriptor |
| 150 public static global::Google.Protobuf.Reflection.ServiceDescriptor Descripto
r |
| 151 { |
| 152 get { return global::Grpc.Testing.ServicesReflection.Descriptor.Services[1
]; } |
| 153 } |
| 154 |
| 155 // client interface |
| 156 public interface IWorkerServiceClient |
| 157 { |
| 158 AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Tes
ting.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline = null,
CancellationToken cancellationToken = default(CancellationToken)); |
| 159 AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::Grpc.Tes
ting.ServerStatus> RunServer(CallOptions options); |
| 160 AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Tes
ting.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline = null,
CancellationToken cancellationToken = default(CancellationToken)); |
| 161 AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::Grpc.Tes
ting.ClientStatus> RunClient(CallOptions options); |
| 162 global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreReque
st request, Metadata headers = null, DateTime? deadline = null, CancellationToke
n cancellationToken = default(CancellationToken)); |
| 163 global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.CoreReque
st request, CallOptions options); |
| 164 AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::G
rpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadline = n
ull, CancellationToken cancellationToken = default(CancellationToken)); |
| 165 AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(global::G
rpc.Testing.CoreRequest request, CallOptions options); |
| 166 global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Me
tadata headers = null, DateTime? deadline = null, CancellationToken cancellation
Token = default(CancellationToken)); |
| 167 global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void request, Ca
llOptions options); |
| 168 AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Tes
ting.Void request, Metadata headers = null, DateTime? deadline = null, Cancellat
ionToken cancellationToken = default(CancellationToken)); |
| 169 AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::Grpc.Tes
ting.Void request, CallOptions options); |
| 170 } |
| 171 |
| 172 // server-side interface |
| 173 public interface IWorkerService |
| 174 { |
| 175 Task RunServer(IAsyncStreamReader<global::Grpc.Testing.ServerArgs> request
Stream, IServerStreamWriter<global::Grpc.Testing.ServerStatus> responseStream, S
erverCallContext context); |
| 176 Task RunClient(IAsyncStreamReader<global::Grpc.Testing.ClientArgs> request
Stream, IServerStreamWriter<global::Grpc.Testing.ClientStatus> responseStream, S
erverCallContext context); |
| 177 Task<global::Grpc.Testing.CoreResponse> CoreCount(global::Grpc.Testing.Cor
eRequest request, ServerCallContext context); |
| 178 Task<global::Grpc.Testing.Void> QuitWorker(global::Grpc.Testing.Void reque
st, ServerCallContext context); |
| 179 } |
| 180 |
| 181 // client stub |
| 182 public class WorkerServiceClient : ClientBase, IWorkerServiceClient |
| 183 { |
| 184 public WorkerServiceClient(Channel channel) : base(channel) |
| 185 { |
| 186 } |
| 187 public AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::G
rpc.Testing.ServerStatus> RunServer(Metadata headers = null, DateTime? deadline
= null, CancellationToken cancellationToken = default(CancellationToken)) |
| 188 { |
| 189 var call = CreateCall(__Method_RunServer, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 190 return Calls.AsyncDuplexStreamingCall(call); |
| 191 } |
| 192 public AsyncDuplexStreamingCall<global::Grpc.Testing.ServerArgs, global::G
rpc.Testing.ServerStatus> RunServer(CallOptions options) |
| 193 { |
| 194 var call = CreateCall(__Method_RunServer, options); |
| 195 return Calls.AsyncDuplexStreamingCall(call); |
| 196 } |
| 197 public AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::G
rpc.Testing.ClientStatus> RunClient(Metadata headers = null, DateTime? deadline
= null, CancellationToken cancellationToken = default(CancellationToken)) |
| 198 { |
| 199 var call = CreateCall(__Method_RunClient, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 200 return Calls.AsyncDuplexStreamingCall(call); |
| 201 } |
| 202 public AsyncDuplexStreamingCall<global::Grpc.Testing.ClientArgs, global::G
rpc.Testing.ClientStatus> RunClient(CallOptions options) |
| 203 { |
| 204 var call = CreateCall(__Method_RunClient, options); |
| 205 return Calls.AsyncDuplexStreamingCall(call); |
| 206 } |
| 207 public global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.Co
reRequest request, Metadata headers = null, DateTime? deadline = null, Cancellat
ionToken cancellationToken = default(CancellationToken)) |
| 208 { |
| 209 var call = CreateCall(__Method_CoreCount, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 210 return Calls.BlockingUnaryCall(call, request); |
| 211 } |
| 212 public global::Grpc.Testing.CoreResponse CoreCount(global::Grpc.Testing.Co
reRequest request, CallOptions options) |
| 213 { |
| 214 var call = CreateCall(__Method_CoreCount, options); |
| 215 return Calls.BlockingUnaryCall(call, request); |
| 216 } |
| 217 public AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(gl
obal::Grpc.Testing.CoreRequest request, Metadata headers = null, DateTime? deadl
ine = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 218 { |
| 219 var call = CreateCall(__Method_CoreCount, new CallOptions(headers, deadl
ine, cancellationToken)); |
| 220 return Calls.AsyncUnaryCall(call, request); |
| 221 } |
| 222 public AsyncUnaryCall<global::Grpc.Testing.CoreResponse> CoreCountAsync(gl
obal::Grpc.Testing.CoreRequest request, CallOptions options) |
| 223 { |
| 224 var call = CreateCall(__Method_CoreCount, options); |
| 225 return Calls.AsyncUnaryCall(call, request); |
| 226 } |
| 227 public global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void requ
est, Metadata headers = null, DateTime? deadline = null, CancellationToken cance
llationToken = default(CancellationToken)) |
| 228 { |
| 229 var call = CreateCall(__Method_QuitWorker, new CallOptions(headers, dead
line, cancellationToken)); |
| 230 return Calls.BlockingUnaryCall(call, request); |
| 231 } |
| 232 public global::Grpc.Testing.Void QuitWorker(global::Grpc.Testing.Void requ
est, CallOptions options) |
| 233 { |
| 234 var call = CreateCall(__Method_QuitWorker, options); |
| 235 return Calls.BlockingUnaryCall(call, request); |
| 236 } |
| 237 public AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::G
rpc.Testing.Void request, Metadata headers = null, DateTime? deadline = null, Ca
ncellationToken cancellationToken = default(CancellationToken)) |
| 238 { |
| 239 var call = CreateCall(__Method_QuitWorker, new CallOptions(headers, dead
line, cancellationToken)); |
| 240 return Calls.AsyncUnaryCall(call, request); |
| 241 } |
| 242 public AsyncUnaryCall<global::Grpc.Testing.Void> QuitWorkerAsync(global::G
rpc.Testing.Void request, CallOptions options) |
| 243 { |
| 244 var call = CreateCall(__Method_QuitWorker, options); |
| 245 return Calls.AsyncUnaryCall(call, request); |
| 246 } |
| 247 } |
| 248 |
| 249 // creates service definition that can be registered with a server |
| 250 public static ServerServiceDefinition BindService(IWorkerService serviceImpl
) |
| 251 { |
| 252 return ServerServiceDefinition.CreateBuilder(__ServiceName) |
| 253 .AddMethod(__Method_RunServer, serviceImpl.RunServer) |
| 254 .AddMethod(__Method_RunClient, serviceImpl.RunClient) |
| 255 .AddMethod(__Method_CoreCount, serviceImpl.CoreCount) |
| 256 .AddMethod(__Method_QuitWorker, serviceImpl.QuitWorker).Build(); |
| 257 } |
| 258 |
| 259 // creates a new client |
| 260 public static WorkerServiceClient NewClient(Channel channel) |
| 261 { |
| 262 return new WorkerServiceClient(channel); |
| 263 } |
| 264 |
| 265 } |
| 266 } |
| 267 #endregion |
OLD | NEW |