diff options
author | 2018-11-08 10:56:53 +0100 | |
---|---|---|
committer | 2018-11-08 10:56:53 +0100 | |
commit | abbb317feed4f1732a3abb69595dc6b39e1bb124 (patch) | |
tree | e00ebb0c1e23ed29643c9bff185ecedaa64e440e /src | |
parent | 35e1f9fa6a318dac3fe232d99a5a41768f12197f (diff) |
add ServiceBinderBase
Diffstat (limited to 'src')
-rw-r--r-- | src/csharp/Grpc.Core/ServerServiceDefinition.cs | 8 | ||||
-rw-r--r-- | src/csharp/Grpc.Core/ServiceBinderBase.cs | 101 |
2 files changed, 105 insertions, 4 deletions
diff --git a/src/csharp/Grpc.Core/ServerServiceDefinition.cs b/src/csharp/Grpc.Core/ServerServiceDefinition.cs index 07c6aa1796..b040ab379c 100644 --- a/src/csharp/Grpc.Core/ServerServiceDefinition.cs +++ b/src/csharp/Grpc.Core/ServerServiceDefinition.cs @@ -72,7 +72,7 @@ namespace Grpc.Core } /// <summary> - /// Adds a definitions for a single request - single response method. + /// Adds a definition for a single request - single response method. /// </summary> /// <typeparam name="TRequest">The request message class.</typeparam> /// <typeparam name="TResponse">The response message class.</typeparam> @@ -90,7 +90,7 @@ namespace Grpc.Core } /// <summary> - /// Adds a definitions for a client streaming method. + /// Adds a definition for a client streaming method. /// </summary> /// <typeparam name="TRequest">The request message class.</typeparam> /// <typeparam name="TResponse">The response message class.</typeparam> @@ -108,7 +108,7 @@ namespace Grpc.Core } /// <summary> - /// Adds a definitions for a server streaming method. + /// Adds a definition for a server streaming method. /// </summary> /// <typeparam name="TRequest">The request message class.</typeparam> /// <typeparam name="TResponse">The response message class.</typeparam> @@ -126,7 +126,7 @@ namespace Grpc.Core } /// <summary> - /// Adds a definitions for a bidirectional streaming method. + /// Adds a definition for a bidirectional streaming method. /// </summary> /// <typeparam name="TRequest">The request message class.</typeparam> /// <typeparam name="TResponse">The response message class.</typeparam> diff --git a/src/csharp/Grpc.Core/ServiceBinderBase.cs b/src/csharp/Grpc.Core/ServiceBinderBase.cs new file mode 100644 index 0000000000..d4909f4a26 --- /dev/null +++ b/src/csharp/Grpc.Core/ServiceBinderBase.cs @@ -0,0 +1,101 @@ +#region Copyright notice and license + +// Copyright 2018 The gRPC Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#endregion + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using Grpc.Core.Interceptors; +using Grpc.Core.Internal; +using Grpc.Core.Utils; + +namespace Grpc.Core +{ + /// <summary> + /// Allows binding server-side method implementations in alternative serving stacks. + /// Instances of this class are usually populated by the <c>BindService</c> method + /// that is part of the autogenerated code for a protocol buffers service definition. + /// <seealso cref="ServerServiceDefinition"/> + /// </summary> + public class ServiceBinderBase + { + /// <summary> + /// Adds a definition for a single request - single response method. + /// </summary> + /// <typeparam name="TRequest">The request message class.</typeparam> + /// <typeparam name="TResponse">The response message class.</typeparam> + /// <param name="method">The method.</param> + /// <param name="handler">The method handler.</param> + public virtual void AddMethod<TRequest, TResponse>( + Method<TRequest, TResponse> method, + UnaryServerMethod<TRequest, TResponse> handler) + where TRequest : class + where TResponse : class + { + throw new NotImplementedException(); + } + + /// <summary> + /// Adds a definition for a client streaming method. + /// </summary> + /// <typeparam name="TRequest">The request message class.</typeparam> + /// <typeparam name="TResponse">The response message class.</typeparam> + /// <param name="method">The method.</param> + /// <param name="handler">The method handler.</param> + public virtual void AddMethod<TRequest, TResponse>( + Method<TRequest, TResponse> method, + ClientStreamingServerMethod<TRequest, TResponse> handler) + where TRequest : class + where TResponse : class + { + throw new NotImplementedException(); + } + + /// <summary> + /// Adds a definition for a server streaming method. + /// </summary> + /// <typeparam name="TRequest">The request message class.</typeparam> + /// <typeparam name="TResponse">The response message class.</typeparam> + /// <param name="method">The method.</param> + /// <param name="handler">The method handler.</param> + public virtual void AddMethod<TRequest, TResponse>( + Method<TRequest, TResponse> method, + ServerStreamingServerMethod<TRequest, TResponse> handler) + where TRequest : class + where TResponse : class + { + throw new NotImplementedException(); + } + + /// <summary> + /// Adds a definition for a bidirectional streaming method. + /// </summary> + /// <typeparam name="TRequest">The request message class.</typeparam> + /// <typeparam name="TResponse">The response message class.</typeparam> + /// <param name="method">The method.</param> + /// <param name="handler">The method handler.</param> + public virtual void AddMethod<TRequest, TResponse>( + Method<TRequest, TResponse> method, + DuplexStreamingServerMethod<TRequest, TResponse> handler) + where TRequest : class + where TResponse : class + { + throw new NotImplementedException(); + } + } +} |