最近比较喜欢的一个并行实现,可以实时查看结果:
from concurrent.futures import ProcessPoolExecutor, as_completed
executor = ProcessPoolExecutor(max_workers=5)
tasks = [executor.submit(run_func, server) for arg in args]
results = {}
for future in as_completed(tasks):
result = future.result()
results.append(result)
http://www.open-open.com/news/view/1c0179b/
黄世宇/Shiyu Huang's Personal Page:https://huangshiyu13.github.io/