You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to process results as soon as they are available, so I am using:
asyncforresultinpool.map(run_one_job, jobs_data):
However, some of them take way more time than others. So it happens that many results are already ready, but the above for loop is blocked and is waiting because it can only give results in order.
I would like to have something like .map_unordered()
It seems to me that it is currently impossible to do it, and it would require implementing this functionality in aiomultiprocess.
Details
OS: Ubuntu on Win10 WSL
Python version: 3.9
aiomultiprocess version: 0.9.0
Can you repro on master? ---
Can you repro in a clean virtualenv? ---
The text was updated successfully, but these errors were encountered:
I think this would be a relatively easy addition to pool.Pool. I'd ideally like to see it called imap() to match the standard multiprocessing module, but would need to implement an unordered version of PoolResult and/or Pool.results(). Happy to give guidance if someone wants to work on this before I have the time.
Hmm, you're right. I misremembered what imap actually meant in this context. map_unordered does seem to be a better fit in that case, given that aiomultiprocess doesn't really do anything "lazy" in processing tasks/results.
Description
I have a lot of async jobs (>10000).
I want to process results as soon as they are available, so I am using:
However, some of them take way more time than others. So it happens that many results are already ready, but the above
for
loop is blocked and is waiting because it can only give results in order.I would like to have something like
.map_unordered()
It seems to me that it is currently impossible to do it, and it would require implementing this functionality in
aiomultiprocess
.Details
The text was updated successfully, but these errors were encountered: