public void AddUnaryMethod <TRequest, TResponse>(
     GrpcCore.Method <TRequest, TResponse> method,
     ImmutableArray <object> metadata,
     UnaryServerMethod <NetGrpcServiceActivator <TService>, TRequest, TResponse> handler)
     where TRequest : class
     where TResponse : class
 {
     this.stubs.Add(new TestGrpcMethodStub(method, typeof(TRequest), typeof(TResponse), metadata));
 }
Ejemplo n.º 2
0
        public override sealed TResponse BlockingUnaryCall <TRequest, TResponse>(GrpcCore.Method <TRequest, TResponse> method, string host, GrpcCore.CallOptions options, TRequest request)
        {
            Assert.NotNull(method);
            Assert.IsNotEmpty(method.Name);

            var response = UnaryFunc <TRequest, TResponse>(method.Name, request);

            return(response);
        }
 public void AddMethod <TRequest, TResponse>(GrpcCore.Method <TRequest, TResponse> method, GrpcCore.ServerStreamingServerMethod <TRequest, TResponse> handler) where TResponse : class where TRequest : class
 {
     this.stubs.Add(new TestGrpcMethodStub(method, typeof(TRequest), typeof(TResponse), null));
 }
Ejemplo n.º 4
0
        public override sealed GrpcCore.AsyncUnaryCall <TResponse> AsyncUnaryCall <TRequest, TResponse>(GrpcCore.Method <TRequest, TResponse> method, string host, GrpcCore.CallOptions options, TRequest request)
        {
            Assert.NotNull(method);
            Assert.IsNotEmpty(method.Name);

            var response = UnaryFunc <TRequest, TResponse>(method.Name, request);

            return(new GrpcCore.AsyncUnaryCall <TResponse>(Task.FromResult(response), null, null, null, () => { }));
        }
Ejemplo n.º 5
0
 public override sealed GrpcCore.AsyncServerStreamingCall <TResponse> AsyncServerStreamingCall <TRequest, TResponse>(GrpcCore.Method <TRequest, TResponse> method, string host, GrpcCore.CallOptions options, TRequest request)
 {
     return(new GrpcCore.AsyncServerStreamingCall <TResponse>(ServerStreamingFunc <TRequest, TResponse>(method.Name, request, options.CancellationToken), Task.FromResult(new GrpcCore.Metadata()), null, null, () => { }));
 }
Ejemplo n.º 6
0
 public override sealed GrpcCore.AsyncDuplexStreamingCall <TRequest, TResponse> AsyncDuplexStreamingCall <TRequest, TResponse>(GrpcCore.Method <TRequest, TResponse> method, string host, GrpcCore.CallOptions options)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
 public void AddMethod <TRequest, TResponse>(GrpcCore.Method <TRequest, TResponse> method, GrpcCore.ServerStreamingServerMethod <TRequest, TResponse> handler) where TResponse : class where TRequest : class
 {
     this.builder.AddMethod(method, handler);
 }