コード例 #1
0
 public async Task StreamingOutputCall(ServerCallContext context, StreamingOutputCallRequest request, IServerStreamWriter <StreamingOutputCallResponse> responseStream)
 {
     foreach (var responseParam in request.ResponseParametersList)
     {
         var response = StreamingOutputCallResponse.CreateBuilder()
                        .SetPayload(CreateZerosPayload(responseParam.Size)).Build();
         await responseStream.Write(response);
     }
 }
コード例 #2
0
ファイル: TestServiceImpl.cs プロジェクト: wfarr/grpc
 public void OnNext(StreamingOutputCallRequest value)
 {
     foreach (var responseParam in value.ResponseParametersList)
     {
         var response = StreamingOutputCallResponse.CreateBuilder()
                        .SetPayload(CreateZerosPayload(responseParam.Size)).Build();
         responseObserver.OnNext(response);
     }
 }
コード例 #3
0
 public void StreamingOutputCall(StreamingOutputCallRequest request, IObserver <StreamingOutputCallResponse> responseObserver)
 {
     foreach (var responseParam in request.ResponseParametersList)
     {
         var response = StreamingOutputCallResponse.CreateBuilder()
                        .SetPayload(CreateZerosPayload(responseParam.Size)).Build();
         responseObserver.OnNext(response);
     }
     responseObserver.OnCompleted();
 }
コード例 #4
0
 public async Task FullDuplexCall(ServerCallContext context, IAsyncStreamReader <StreamingOutputCallRequest> requestStream, IServerStreamWriter <StreamingOutputCallResponse> responseStream)
 {
     await requestStream.ForEach(async request =>
     {
         foreach (var responseParam in request.ResponseParametersList)
         {
             var response = StreamingOutputCallResponse.CreateBuilder()
                            .SetPayload(CreateZerosPayload(responseParam.Size)).Build();
             await responseStream.Write(response);
         }
     });
 }
コード例 #5
0
            public void OnNext(StreamingOutputCallRequest value)
            {
                // TODO: this is not in order!!!
                //Task.Factory.StartNew(() => {

                foreach (var responseParam in value.ResponseParametersList)
                {
                    var response = StreamingOutputCallResponse.CreateBuilder()
                                   .SetPayload(CreateZerosPayload(responseParam.Size)).Build();
                    responseObserver.OnNext(response);
                }
                //});
            }