def process(self, buckets, event=None):
results = []
with self.executor_factory(max_workers=2) as w:
futures = {}
for b in buckets:
futures[w.submit(self.process_bucket, b)] = b
for f in as_completed(futures):
b = futures[f]
if f.exception():
self.log.error(
"Error processing bucket: %s error: %s",
b['Name'], f.exception())
continue
if f.result():
results.append(b)
return results
评论列表
文章目录