Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: third_party/grpc/src/csharp/Grpc.Examples/MathGrpc.cs

Issue 1932353002: Initial checkin of gRPC to third_party/ Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/grpc/src/csharp/Grpc.Examples/MathGrpc.cs
diff --git a/third_party/grpc/src/csharp/Grpc.Examples/MathGrpc.cs b/third_party/grpc/src/csharp/Grpc.Examples/MathGrpc.cs
new file mode 100644
index 0000000000000000000000000000000000000000..a6e878d0f48b6ea3e0b2e8b6540f8ae82174aaab
--- /dev/null
+++ b/third_party/grpc/src/csharp/Grpc.Examples/MathGrpc.cs
@@ -0,0 +1,154 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: math.proto
+#region Designer generated code
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Grpc.Core;
+
+namespace Math {
+ public static class Math
+ {
+ static readonly string __ServiceName = "math.Math";
+
+ static readonly Marshaller<global::Math.DivArgs> __Marshaller_DivArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivArgs.Parser.ParseFrom);
+ static readonly Marshaller<global::Math.DivReply> __Marshaller_DivReply = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.DivReply.Parser.ParseFrom);
+ static readonly Marshaller<global::Math.FibArgs> __Marshaller_FibArgs = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.FibArgs.Parser.ParseFrom);
+ static readonly Marshaller<global::Math.Num> __Marshaller_Num = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Math.Num.Parser.ParseFrom);
+
+ static readonly Method<global::Math.DivArgs, global::Math.DivReply> __Method_Div = new Method<global::Math.DivArgs, global::Math.DivReply>(
+ MethodType.Unary,
+ __ServiceName,
+ "Div",
+ __Marshaller_DivArgs,
+ __Marshaller_DivReply);
+
+ static readonly Method<global::Math.DivArgs, global::Math.DivReply> __Method_DivMany = new Method<global::Math.DivArgs, global::Math.DivReply>(
+ MethodType.DuplexStreaming,
+ __ServiceName,
+ "DivMany",
+ __Marshaller_DivArgs,
+ __Marshaller_DivReply);
+
+ static readonly Method<global::Math.FibArgs, global::Math.Num> __Method_Fib = new Method<global::Math.FibArgs, global::Math.Num>(
+ MethodType.ServerStreaming,
+ __ServiceName,
+ "Fib",
+ __Marshaller_FibArgs,
+ __Marshaller_Num);
+
+ static readonly Method<global::Math.Num, global::Math.Num> __Method_Sum = new Method<global::Math.Num, global::Math.Num>(
+ MethodType.ClientStreaming,
+ __ServiceName,
+ "Sum",
+ __Marshaller_Num,
+ __Marshaller_Num);
+
+ // service descriptor
+ public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
+ {
+ get { return global::Math.MathReflection.Descriptor.Services[0]; }
+ }
+
+ // client interface
+ public interface IMathClient
+ {
+ global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options);
+ AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, CallOptions options);
+ AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(CallOptions options);
+ AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, CallOptions options);
+ AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
+ AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(CallOptions options);
+ }
+
+ // server-side interface
+ public interface IMath
+ {
+ Task<global::Math.DivReply> Div(global::Math.DivArgs request, ServerCallContext context);
+ Task DivMany(IAsyncStreamReader<global::Math.DivArgs> requestStream, IServerStreamWriter<global::Math.DivReply> responseStream, ServerCallContext context);
+ Task Fib(global::Math.FibArgs request, IServerStreamWriter<global::Math.Num> responseStream, ServerCallContext context);
+ Task<global::Math.Num> Sum(IAsyncStreamReader<global::Math.Num> requestStream, ServerCallContext context);
+ }
+
+ // client stub
+ public class MathClient : ClientBase, IMathClient
+ {
+ public MathClient(Channel channel) : base(channel)
+ {
+ }
+ public global::Math.DivReply Div(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.BlockingUnaryCall(call, request);
+ }
+ public global::Math.DivReply Div(global::Math.DivArgs request, CallOptions options)
+ {
+ var call = CreateCall(__Method_Div, options);
+ return Calls.BlockingUnaryCall(call, request);
+ }
+ public AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var call = CreateCall(__Method_Div, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.AsyncUnaryCall(call, request);
+ }
+ public AsyncUnaryCall<global::Math.DivReply> DivAsync(global::Math.DivArgs request, CallOptions options)
+ {
+ var call = CreateCall(__Method_Div, options);
+ return Calls.AsyncUnaryCall(call, request);
+ }
+ public AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var call = CreateCall(__Method_DivMany, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.AsyncDuplexStreamingCall(call);
+ }
+ public AsyncDuplexStreamingCall<global::Math.DivArgs, global::Math.DivReply> DivMany(CallOptions options)
+ {
+ var call = CreateCall(__Method_DivMany, options);
+ return Calls.AsyncDuplexStreamingCall(call);
+ }
+ public AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var call = CreateCall(__Method_Fib, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.AsyncServerStreamingCall(call, request);
+ }
+ public AsyncServerStreamingCall<global::Math.Num> Fib(global::Math.FibArgs request, CallOptions options)
+ {
+ var call = CreateCall(__Method_Fib, options);
+ return Calls.AsyncServerStreamingCall(call, request);
+ }
+ public AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ var call = CreateCall(__Method_Sum, new CallOptions(headers, deadline, cancellationToken));
+ return Calls.AsyncClientStreamingCall(call);
+ }
+ public AsyncClientStreamingCall<global::Math.Num, global::Math.Num> Sum(CallOptions options)
+ {
+ var call = CreateCall(__Method_Sum, options);
+ return Calls.AsyncClientStreamingCall(call);
+ }
+ }
+
+ // creates service definition that can be registered with a server
+ public static ServerServiceDefinition BindService(IMath serviceImpl)
+ {
+ return ServerServiceDefinition.CreateBuilder(__ServiceName)
+ .AddMethod(__Method_Div, serviceImpl.Div)
+ .AddMethod(__Method_DivMany, serviceImpl.DivMany)
+ .AddMethod(__Method_Fib, serviceImpl.Fib)
+ .AddMethod(__Method_Sum, serviceImpl.Sum).Build();
+ }
+
+ // creates a new client
+ public static MathClient NewClient(Channel channel)
+ {
+ return new MathClient(channel);
+ }
+
+ }
+}
+#endregion

Powered by Google App Engine
This is Rietveld 408576698