jeudi 13 août 2015

Error handling with imap_unordered in python multiprocessing

I'm trying to use pool.imap_unordered from python multiprocessing to query an external service. What I would like to do is split the input into smaller tasks if one fails. Right now I've got something like the following:

results = []
for result in pool.imap_unordered(query_service, tasks):
    results.append(result)

Does imap_unordered reraise exceptions, is result an exception if a child task fails or does it just retry continuously?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire