ServiceBinderBase.cs 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #region Copyright notice and license
  2. // Copyright 2018 The gRPC Authors
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. #endregion
  16. using System;
  17. using System.Collections.Generic;
  18. using System.Collections.ObjectModel;
  19. using System.Linq;
  20. using Grpc.Core.Utils;
  21. namespace Grpc.Core
  22. {
  23. /// <summary>
  24. /// Allows binding server-side method implementations in alternative serving stacks.
  25. /// Instances of this class are usually populated by the <c>BindService</c> method
  26. /// that is part of the autogenerated code for a protocol buffers service definition.
  27. /// </summary>
  28. public class ServiceBinderBase
  29. {
  30. /// <summary>
  31. /// Adds a definition for a single request - single response method.
  32. /// </summary>
  33. /// <typeparam name="TRequest">The request message class.</typeparam>
  34. /// <typeparam name="TResponse">The response message class.</typeparam>
  35. /// <param name="method">The method.</param>
  36. /// <param name="handler">The method handler.</param>
  37. public virtual void AddMethod<TRequest, TResponse>(
  38. Method<TRequest, TResponse> method,
  39. UnaryServerMethod<TRequest, TResponse> handler)
  40. where TRequest : class
  41. where TResponse : class
  42. {
  43. throw new NotImplementedException();
  44. }
  45. /// <summary>
  46. /// Adds a definition for a client streaming method.
  47. /// </summary>
  48. /// <typeparam name="TRequest">The request message class.</typeparam>
  49. /// <typeparam name="TResponse">The response message class.</typeparam>
  50. /// <param name="method">The method.</param>
  51. /// <param name="handler">The method handler.</param>
  52. public virtual void AddMethod<TRequest, TResponse>(
  53. Method<TRequest, TResponse> method,
  54. ClientStreamingServerMethod<TRequest, TResponse> handler)
  55. where TRequest : class
  56. where TResponse : class
  57. {
  58. throw new NotImplementedException();
  59. }
  60. /// <summary>
  61. /// Adds a definition for a server streaming method.
  62. /// </summary>
  63. /// <typeparam name="TRequest">The request message class.</typeparam>
  64. /// <typeparam name="TResponse">The response message class.</typeparam>
  65. /// <param name="method">The method.</param>
  66. /// <param name="handler">The method handler.</param>
  67. public virtual void AddMethod<TRequest, TResponse>(
  68. Method<TRequest, TResponse> method,
  69. ServerStreamingServerMethod<TRequest, TResponse> handler)
  70. where TRequest : class
  71. where TResponse : class
  72. {
  73. throw new NotImplementedException();
  74. }
  75. /// <summary>
  76. /// Adds a definition for a bidirectional streaming method.
  77. /// </summary>
  78. /// <typeparam name="TRequest">The request message class.</typeparam>
  79. /// <typeparam name="TResponse">The response message class.</typeparam>
  80. /// <param name="method">The method.</param>
  81. /// <param name="handler">The method handler.</param>
  82. public virtual void AddMethod<TRequest, TResponse>(
  83. Method<TRequest, TResponse> method,
  84. DuplexStreamingServerMethod<TRequest, TResponse> handler)
  85. where TRequest : class
  86. where TResponse : class
  87. {
  88. throw new NotImplementedException();
  89. }
  90. }
  91. }