aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/ServerServiceDefinition.cs
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2015-05-07 17:20:24 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2015-05-07 17:20:24 -0700
commit4251aad3eb7bbc9220c8b4a8064da82416409ab3 (patch)
treecfbf2db24e0f40ab79fb535923873130b944c4b3 /src/csharp/Grpc.Core/ServerServiceDefinition.cs
parentd4f10c03209e731cf5d1793a23d3823ea2b05493 (diff)
parent442918f225797e28e1bfee023046af4f441a50ae (diff)
Merge branch 'master' of github.com:grpc/grpc into standalone_benchmarks
Diffstat (limited to 'src/csharp/Grpc.Core/ServerServiceDefinition.cs')
-rw-r--r--src/csharp/Grpc.Core/ServerServiceDefinition.cs32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/csharp/Grpc.Core/ServerServiceDefinition.cs b/src/csharp/Grpc.Core/ServerServiceDefinition.cs
index f08c7d88f3..81846beb2f 100644
--- a/src/csharp/Grpc.Core/ServerServiceDefinition.cs
+++ b/src/csharp/Grpc.Core/ServerServiceDefinition.cs
@@ -75,17 +75,41 @@ namespace Grpc.Core
public Builder AddMethod<TRequest, TResponse>(
Method<TRequest, TResponse> method,
- UnaryRequestServerMethod<TRequest, TResponse> handler)
+ UnaryServerMethod<TRequest, TResponse> handler)
+ where TRequest : class
+ where TResponse : class
{
- callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.UnaryRequestCall(method, handler));
+ callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.UnaryCall(method, handler));
return this;
}
public Builder AddMethod<TRequest, TResponse>(
Method<TRequest, TResponse> method,
- StreamingRequestServerMethod<TRequest, TResponse> handler)
+ ClientStreamingServerMethod<TRequest, TResponse> handler)
+ where TRequest : class
+ where TResponse : class
{
- callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.StreamingRequestCall(method, handler));
+ callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.ClientStreamingCall(method, handler));
+ return this;
+ }
+
+ public Builder AddMethod<TRequest, TResponse>(
+ Method<TRequest, TResponse> method,
+ ServerStreamingServerMethod<TRequest, TResponse> handler)
+ where TRequest : class
+ where TResponse : class
+ {
+ callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.ServerStreamingCall(method, handler));
+ return this;
+ }
+
+ public Builder AddMethod<TRequest, TResponse>(
+ Method<TRequest, TResponse> method,
+ DuplexStreamingServerMethod<TRequest, TResponse> handler)
+ where TRequest : class
+ where TResponse : class
+ {
+ callHandlers.Add(GetFullMethodName(serviceName, method.Name), ServerCalls.DuplexStreamingCall(method, handler));
return this;
}