Closed ulfaslak closed 6 years ago
This is because the Pool.map
function gathers the whole iterator into a list before applying the supplied worker function.
Pool.imap
might be what you're looking for, as it returns an iterator over the results instead of blocking to create a list with all results at once.
data = log_progress(pool.imap(func, args_list), size=len(args_list))
for e in data:
...
Currently, it's possible to do something like:
If I try to do the same using a multiprocessing mapper, the progress bar is immediately completed.
Would it be possible to somehow make this work?