s3_service.py 文件源码

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

项目:orca 作者: bdastur 项目源码 文件源码
def list_buckets_fast(self):
        buckets = []
        jobs = []
        for profile in self.clients.keys():
            queue = mp.Queue()
            kwargs = {'profile_names': profile,
                      'queue': queue}

            process = mp.Process(target=self.list_buckets,
                                 kwargs=kwargs)
            process.start()
            jobs.append((process, queue))

        count = 0
        for job in jobs:
            process = job[0]
            queue = job[1]
            process.join()
            profile_buckets = queue.get()
            buckets.extend(profile_buckets)
            count += 1

        for job in jobs:
            process = job[0]
            if process.is_alive():
                process.terminate()

        return buckets
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号