client.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Python_Study 作者: thsheep 项目源码 文件源码
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()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号