Skip to content

use Promise.all#37

Merged
severo merged 1 commit intomasterfrom
promise-all
Feb 7, 2025
Merged

use Promise.all#37
severo merged 1 commit intomasterfrom
promise-all

Conversation

@severo
Copy link
Copy Markdown
Contributor

@severo severo commented Feb 6, 2025

I think it's better:

  • the promises run in parallel, not serially
  • it raises faster (if it raises)

@severo severo requested a review from platypii February 6, 2025 21:35
Copy link
Copy Markdown
Contributor

@platypii platypii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical nitpick on the PR description: they were already running "in parallel" not serially. Promises are started when they are created, not when they are awaited.

But you're 100% right that this way will fail faster if there is an error.

@severo
Copy link
Copy Markdown
Contributor Author

severo commented Feb 7, 2025

Thanks for clarifying! I updated the description.

@severo severo merged commit 04720ca into master Feb 7, 2025
@severo severo deleted the promise-all branch February 7, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants