Timeline for What is the best way to limit concurrency when using ES6's Promise.all()?
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 28, 2023 at 1:23 | comment | added | Kamafeather |
@chovy one way is to store the return value from the await into a variable or array, like const results = [] before the while , and then you can get the return value by results.push(await Promise.all()) .
|
|
Feb 18, 2023 at 19:56 | comment | added | chovy | How do I get the results? | |
Dec 20, 2022 at 12:18 | comment | added | Falco | @Álvaro no - "await" is the magic keyword, which will not block the event loop until it resolves | |
Sep 14, 2021 at 12:58 | history | edited | hiddensunset4 | CC BY-SA 4.0 |
Fix typo
|
Jun 21, 2021 at 21:03 | comment | added | Álvaro | Is this blocking the event loop? | |
Jun 15, 2021 at 22:45 | comment | added | adi518 | Very cool. However, it only batches, which means it won't push a new promise when another promise resolves. | |
Jul 25, 2020 at 1:12 | comment | added | Casey Dwayne | Very useful for running in batches. Note: the next batch will not start until the current batch 100% complete. | |
Jun 26, 2020 at 22:16 | comment | added | Endless |
took a sec to grasp what it's doing with lack of more context around it, like it beeing a batch instead of a pool for instance. You are reordering the array everytime you you splice from the beginning or in the middle. (browser have to reindex all items) a theoretical performance better alternativ is to take stuff from the end instead arr.splice(-100) if the order dose not mather, maybe you can reverse the array :P
|
|
Apr 16, 2020 at 4:35 | comment | added | cltsang | This runs functions in batches instead of pool, where one function is immediately called when another finishes. | |
Nov 4, 2019 at 3:36 | history | edited | hiddensunset4 | CC BY-SA 4.0 |
added 21 characters in body
|
Nov 4, 2019 at 3:28 | history | answered | hiddensunset4 | CC BY-SA 4.0 |