__init__.py 文件源码

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

项目:Requester 作者: kylebebak 项目源码 文件源码
def make_requests(self, requests, env=None):
        """Make requests concurrently using a `ThreadPool`, which itself runs on
        an alternate thread so as not to block the UI.
        """
        pools = self.RESPONSE_POOLS
        pool = ResponseThreadPool(requests, env, self.MAX_WORKERS)  # pass along env vars to thread pool
        pools.put(pool)
        while pools.qsize() > self.MAX_NUM_RESPONSE_POOLS:
            old_pool = pools.get()
            old_pool.is_done = True  # don't display responses for a pool which has already been removed
        sublime.set_timeout_async(pool.run, 0)  # run on an alternate thread
        sublime.set_timeout(lambda: self.gather_responses(pool), 15)
        # small delay to show activity for requests that are returned in less than REFRESH_MS
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号