11/34
Part 4 of 8 · PoolsLearn and do

An exception inside a worker stops pool.map at that item, so catch it inside the worker

The future keeps the exception, and pool.map raises it in your loop when the loop reaches that item. Measured on items 0 to 7 with 2 workers, each item sleeping 50 ms and returning k * 10, except item 2, which raises ZeroDivisionError:

Predict

pool.map on items 0 to 7, 2 workers, and item 2 raises. Which items never run?

Pick an answer above to see the rest