/// <summary> /// Adds a duplex streaming method to a service. /// </summary> /// <typeparam name="TRequest">Request message type for this method.</typeparam> /// <typeparam name="TResponse">Response message type for this method.</typeparam> /// <param name="method">The method description.</param> /// <param name="metadata">The method metadata. This metadata can be used by routing and middleware when invoking a gRPC method.</param> /// <param name="invoker">The method invoker that is executed when the method is called.</param> public void AddDuplexStreamingMethod <TRequest, TResponse>(Method <TRequest, TResponse> method, IList <object> metadata, DuplexStreamingServerMethod <TService, TRequest, TResponse> invoker) where TRequest : class where TResponse : class { var callHandler = _serverCallHandlerFactory.CreateDuplexStreaming <TRequest, TResponse>(method, invoker); AddMethod(method, RoutePatternFactory.Parse(method.FullName), metadata, callHandler.HandleCallAsync); }
/// <summary> /// Adds a duplex streaming method to a service. /// </summary> /// <typeparam name="TRequest">Request message type for this method.</typeparam> /// <typeparam name="TResponse">Response message type for this method.</typeparam> /// <param name="method">The method description.</param> /// <param name="metadata">The method metadata. This metadata can be used by routing and middleware when invoking a gRPC method.</param> /// <param name="invoker">The method invoker that is executed when the method is called.</param> public void AddDuplexStreamingMethod <TRequest, TResponse>(Method <TRequest, TResponse> method, List <object> metadata, DuplexStreamingServerMethod <TService, TRequest, TResponse> invoker) where TRequest : class where TResponse : class { var callHandler = _serverCallHandlerFactory.CreateDuplexStreaming <TRequest, TResponse>(method, invoker); var methodModel = new MethodModel(method, metadata, callHandler.HandleCallAsync); Methods.Add(methodModel); }