Ejemplo n.º 1
0
 def StreamStream(
     self,
     request: typing.Iterator[dummy_pb2.DummyRequest],
     context: grpc.ServicerContext,
 ) -> typing.Iterator[dummy_pb2.DummyReply]:
     for data in request:
         yield dummy_pb2.DummyReply(value=data.value.upper())
Ejemplo n.º 2
0
 def UnaryStream(
     self,
     request: dummy_pb2.DummyRequest,
     context: grpc.ServicerContext,
 ) -> typing.Iterator[dummy_pb2.DummyReply]:
     for char in request.value:
         yield dummy_pb2.DummyReply(value=char)
Ejemplo n.º 3
0
 def StreamUnary(
     self,
     request: typing.Iterator[dummy_pb2.DummyRequest],
     context: grpc.ServicerContext,
 ) -> dummy_pb2.DummyReply:
     return dummy_pb2.DummyReply(value="".join(data.value
                                               for data in request))
Ejemplo n.º 4
0
 def UnaryUnary(
     self,
     request: dummy_pb2.DummyRequest,
     context: grpc.ServicerContext,
 ) -> dummy_pb2.DummyReply:
     return dummy_pb2.DummyReply(value=request.value[::-1])