示例#1
0
文件: asgi.py 项目: lidizheng/sonora
 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)
示例#2
0
文件: asgi.py 项目: lidizheng/sonora
    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)
示例#3
0
文件: asgi.py 项目: lidizheng/sonora
 async def Echo(self, request, context):
     return echo_pb2.EchoResponse(message=request.message)
示例#4
0
文件: asgi.py 项目: lidizheng/sonora
 async def EchoAbort(self, request, context):
     context.set_code(grpc.StatusCode.ABORTED)
     return echo_pb2.EchoResponse(message=request.message)
示例#5
0
 def ServerStreamingEcho(self, request, context):
     for _ in range(request.message_count):
         yield echo_pb2.EchoResponse(message=request.message)