def generate_message(): while True: num = queue.get() print(num) yield schema_pb2.Request(num=num)
def generate_message(): while True: num = queue.get() print(num) # 从队列中取出1,然后依照定义的数据结构,发送请求数据,此处为num yield schema_pb2.Request(num=num)