MCPcopy
hub / github.com/grpc/grpc-go / StreamingOutputCall

Method StreamingOutputCall

interop/test_utils.go:769–786  ·  view source on GitHub ↗
(args *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer)

Source from the content-addressed store, hash-verified

767}
768
769func (s *testServer) StreamingOutputCall(args *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error {
770 cs := args.GetResponseParameters()
771 for _, c := range cs {
772 if us := c.GetIntervalUs(); us > 0 {
773 time.Sleep(time.Duration(us) * time.Microsecond)
774 }
775 pl, err := serverNewPayload(args.GetResponseType(), c.GetSize())
776 if err != nil {
777 return err
778 }
779 if err := stream.Send(&testpb.StreamingOutputCallResponse{
780 Payload: pl,
781 }); err != nil {
782 return err
783 }
784 }
785 return nil
786}
787
788func (s *testServer) StreamingInputCall(stream testgrpc.TestService_StreamingInputCallServer) error {
789 var sum int

Callers

nothing calls this directly

Calls 6

serverNewPayloadFunction · 0.85
GetResponseParametersMethod · 0.80
GetIntervalUsMethod · 0.80
GetSizeMethod · 0.80
SendMethod · 0.65
GetResponseTypeMethod · 0.45

Tested by

no test coverage detected