Skip to main content
Module 8 · Lesson 4 of 432/32 in the course~21 min
Module lessons (4/4)

Challenge: scheduling with Promises

Lesson preview5 hands-on exercises readyJavaScript Course · Module 8 — Practice and composition

Run tasks in series, in parallel and with a concurrency limit.

What you'll learn in this lesson

  • Orchestrate asynchronous task lists in series (for...of + await) and in parallel (Promise.all).
  • Understand why tasks need to be thunk () => promise (started on demand) rather than Promise already in flight.
  • Implement a concurrency-bounded worker pool (runWithLimit(tasks, limit)) preserving the order of results.
  • Avoid overload on rate-limited or resource-limited APIs by combining Promise.all, shared queues, and async/await.

Overview

Asynchronous scheduling combines everything you've seen in the course — closures, arrays, async/await, error handling, and Promise.all — to decide when and how many operations to start at the same time without saturating servers or rate limits.

Sections covered in this lesson

  1. 1Mental model: series vs parallel vs limited worker pool
  2. 2Progressive examples
  3. 3Guided laboratory
  4. 4Check for understanding
Pro Lesson · Module 8 — Practice and composition

Unlock "Challenge: scheduling with Promises" and the full JavaScript Course curriculum

Run tasks in series, in parallel and with a concurrency limit.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in JavaScript Course plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.