예제 #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
 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);
                }
                //});
            }