Get()时python多处理池apply_async的Get参数
我正在调试传递到Python multiprocessing.pool的函数的一些失败运行 例如:Get()时python多处理池apply_async的Get参数,python,python-multiprocessing,Python,Python Multiprocessing,我正在调试传递到Python multiprocessing.pool的函数的一些失败运行 例如: results = [] with multiprocessing.Pool(tasks) as pool: for i in range(len(users)): user = users[i] job = jobs[i] result = pool.apply_async( exporter.export, (user, job
results = []
with multiprocessing.Pool(tasks) as pool:
for i in range(len(users)):
user = users[i]
job = jobs[i]
result = pool.apply_async(
exporter.export,
(user,
job))
results.append(result)
for result in results:
try:
result.get()
except:
# Ideally I can print the problematic user/job here
print('failure')
某些用户/作业组合会导致导出器.export()失败,而其他用户/作业组合不会失败
我想知道哪些是有问题的,哪些不是,但我发现我在这个过程中丢失了传入的参数。(在上面的示例中,我无法判断哪些用户
和作业
参数未通过exporter.export()
函数)
有没有办法获取我稍后调用result.get()
时传入函数的参数