def get2(self, *args, **kwargs):
client = tornado.httpclient.AsyncHTTPClient(max_clients=100)
client.fetch('http://localhost:8888/blocking', callback=self.on_response)
# ???asynchronous???
# future = client.fetch('http://localhost:8888/blocking')
# tornado.ioloop.IOLoop.current().add_future(future, callback=self.on_response)
# future??
# future?add_done_callback??????ioloop?future????????????
# ??????add_done_callback????(?????)
# future.add_done_callback(lambda x: future.set_result(x.result()))
评论列表
文章目录