Back to feed
Dev.to
Dev.to
7/13/2026
Choosing between Promise.all, allSettled, any, and race for concurrent requests

Choosing between Promise.all, allSettled, any, and race for concurrent requests

Original: You reach for `Promise.all` for every concurrent request. Here's when to use the other three.

Short summary

A practical comparison of JavaScript's four concurrent promise combinators: Promise.all, Promise.allSettled, Promise.any, and Promise.race. Each is explained with a concrete use case — allSettled for partial dashboard success, any for CDN failover, race for timeouts. The key insight is that concurrency and failure handling are separate concerns, and defaulting to Promise.all often produces the wrong failure behavior.

  • Promise.allSettled for partial success when some APIs may fail
  • Promise.any for fastest successful response (CDN failover)
  • Promise.race for timeout enforcement on operations without built-in limits

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more