Esempio n. 1
0
async def say_hello_to_many(message_iterator: Stream[HelloRequest]) -> Stream[HelloReply]:
    requests = []
    async for message in message_iterator:
        requests.append(message)

    name = requests[0].name
    for i in range(8):
        name += name
    yield HelloReply(message="Hello, {}".format(name))
Esempio n. 2
0
    def SayHelloToMany(self, request_iterator, context):
        requests = []
        for request in request_iterator:
            requests.append(request)

        name = requests[0].name
        for i in range(8):
            name += name
        yield HelloReply(message='Hello, {}'.format(name))
Esempio n. 3
0
 def SayHelloToMany(self, messages, context):
     for message in messages:
         yield HelloReply(message=message.name[::-1])
Esempio n. 4
0
 def SayHello(self, message, context):
     return HelloReply(message=message.name[::-1])
Esempio n. 5
0
async def say_hello_to_many(message: Stream[HelloRequest]) -> Stream[HelloReply]:
    yield HelloReply(message="Hello, world!")
Esempio n. 6
0
 async def SayHelloToMany(self, input_messages):
     async for _ in input_messages:
         pass
     yield HelloReply(message="Hello, world!")
Esempio n. 7
0
 async def SayHello(self, message):
     return HelloReply(message="Hello, " + message.name)
Esempio n. 8
0
 async def SayHelloToMany(self, input_messages):
     async for message in input_messages:
         await yield_(HelloReply(message=message.name))