This seems useful to me. But I think it would be better if made more eager. Let's say you have tasks A, B, C, D, E to process.
If they complete in order E, D, C, B, A then of course you can't do any in-order processing until they've all completed. But what if they finish in order A, B, E, D, C. I'd like to be able to start working on the A and B results right away. I only skimmed the code, but I think the proposed implementation doesn't support that. On Sat, Jun 26, 2021, 10:28 AM <[email protected]> wrote: > Hello list, it's my first email here, so let me know if this is in any way > out of order. > > I've been working a lot with concurrent.futures lately. I find both `wait` > and `as_completed` very useful, but something I'm usually lacking is a > `wait` version where the order of the futures is preserved. I quickly > hacked a proof of concept to discuss with you and see if anybody else would > find it useful: > https://gist.github.com/santiagobasulto/10b689ba5fcadf307ffc5cd4f4ae00ec > > I also realized that the implementation of `ThreadPoolExecutor.map` could > be greatly simplified with this function as part of the stdlib. > > What do you think? Thanks! > _______________________________________________ > Python-ideas mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/VCXVVTKOZFIA5VKC2ADAVNOYEBSF3HGX/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/GMJ5ATA6A3T2FIZZVF56AUPKQFAT46WM/ Code of Conduct: http://python.org/psf/codeofconduct/
