Exemplo n.º 1
0
 async def ServerStreamingEchoAbort(self, request, context):
     for _ in range(request.message_count // 2):
         yield echo_pb2.EchoResponse(message=request.message)
     context.set_code(grpc.StatusCode.ABORTED)
Exemplo n.º 2
0
    async def ServerStreamingEcho(self, request, context):
        for _ in range(request.message_count):
            yield echo_pb2.EchoResponse(message=request.message)

            await asyncio.sleep(request.message_interval.seconds / 2)
            time.sleep(request.message_interval.seconds / 2)
Exemplo n.º 3
0
 async def Echo(self, request, context):
     return echo_pb2.EchoResponse(message=request.message)
Exemplo n.º 4
0
 async def EchoAbort(self, request, context):
     context.set_code(grpc.StatusCode.ABORTED)
     return echo_pb2.EchoResponse(message=request.message)
Exemplo n.º 5
0
 def ServerStreamingEcho(self, request, context):
     for _ in range(request.message_count):
         yield echo_pb2.EchoResponse(message=request.message)