Promise map improved
Summary
Generalized Mojo::Promise::Map to also support 'any' and 'all_settled' aggregations plus an optional delay
Motivation
Since the deprecation/removal of Mojo::IOLoop::delay, the only concurrency-limiting elegant way is to use Mojo::Promise::map. Since I need the limiting as part of a general purpose functionality, I augmented Mojo::Promise::map to support various kinds of aggregation (all[default], any, all_settled) and an optional delay between processing the promises. Test cases as well as a cookbook entry for Mojo::Promise::map is supplied.
References
LIST RELEVANT ISSUES, PULL REQUESTS AND FORUM DISCUSSIONS HERE
Ruminating a little bit about not support 'race', I think that should be also done. Albeit 'race' could be simply achieved by applying race() directly to the first n items to be started concurrently, it should be supported in map() to get that function "complete" regarding the support of all possible aggregations.
This pull request is now in conflicts. Could you fix it @mjaix? 🙏
This pull request is now in conflicts. Could you fix it @mjaix? 🙏
This pull request is now in conflicts. Could you fix it @mjaix? 🙏