Início / Cursos / Programming
Programming

Asynchronous JavaScript Mastery: From Callbacks to Streams

Master callbacks, Promises, async/await, the event loop, microtasks, and async streaming with runnable, hands-on examples

5 seções 35 aulas Todos os níveis Inglês Certificado ao concluir
O que você vai aprender
  • Understand why JavaScript is single-threaded and how non-blocking I/O keeps it responsive
  • Write and refactor callback code, including error-first callbacks, and recognize callback hell
  • Create, consume, chain, and combine Promises with all, allSettled, race, and any
  • Use async and await fluently, including try/catch error handling and cancellation with AbortController
  • Avoid the sequential-await performance trap and the forEach async trap in loops
  • Explain the event loop, microtask and macrotask queues, and predict exact execution order
  • Build async generators, hand-written async iterators, and streaming pipelines with backpressure and bounded concurrency
  • Spot async race conditions and anti-patterns and design a sound error-handling strategy
Conteúdo do curso

O que está incluído

5 seções · 35 aulas. Expanda cada seção para ver o que ela cobre.

1. Callbacks and the Foundations 6 aulas
  • One Thread to Rule Them All: Why JavaScript Is Async Prévia
  • · Callbacks: Passing Functions as Instructions
  • · Error-First Callbacks and the Node Convention
  • · Callback Hell: When Nesting Goes Wrong
  • · Timers and Scheduling: setTimeout, setInterval, and Zero Delay
  • · Event Emitters: The Publish-Subscribe Pattern
2. Promises in Depth 6 aulas
  • · The Event Loop: The Engine Behind the Magic
  • · Creating and Consuming Promises
  • · Chaining: Flattening the Pyramid
  • · Error Propagation and finally
  • · Running in Parallel: Promise.all and Promise.allSettled
  • · Racing Promises: Promise.race and Promise.any
3. async/await Mastery 6 aulas
  • · Blocking vs Non-Blocking: The Difference That Defines Performance
  • · async and await: Synchronous-Looking Async Code
  • · Error Handling with try/catch/finally
  • · Sequential vs Parallel await: A Common Performance Trap
  • · Awaiting in Loops: forEach Traps and for-of Fixes
  • · Cancellation with AbortController
4. The Event Loop, Microtasks, and Timing 6 aulas
  • · From Callbacks to Promises to async/await: A Short History
  • · Macrotasks vs Microtasks: The Two Queues
  • · queueMicrotask and Manual Scheduling
  • · Ordering Puzzles: Predicting the Output
  • · Starving the Loop: When Microtasks Attack
  • · Offloading Heavy Work to Worker Threads
5. Async Iteration and Streaming 11 aulas
  • · Concurrency Without Parallelism: How JavaScript Juggles
  • · Async Generators and for-await-of
  • · Building an Async Iterator by Hand
  • · Streaming Data and Backpressure
  • · Combining Async Streams and Early Exit
  • · A Practical Async Pipeline End to End
  • · Async Race Conditions: Yes, They Exist Here Too
  • · Common Async Anti-Patterns and How to Avoid Them
  • · Error Handling Strategy Across an Async Codebase
  • · Performance and Memory in Async Code
  • · The Future of Async JavaScript
Sobre este curso
Asynchronous JavaScript is where most developers get stuck. The language runs on a single thread, yet it somehow handles timers, network calls, file reads, and streams all at once without freezing. This course explains exactly how that works and turns it into a skill you can rely on, building from the oldest async tool, the callback, all the way to async generators and streaming pipelines. The course is structured so that concepts and hands-on code are woven together rather than separated. Each section opens with a short conceptual lecture that builds the right mental model, then a run of focused coding lectures puts that model to work in real, runnable examples. You will start with callbacks, error-first conventions, callback hell, timers, and event emitters. You will then master Promises, including creation, chaining, error propagation, and the parallel and racing combinators. From there you move into async and await, sequential versus parallel awaits, awaiting inside loops, and cancellation with AbortController. The second half goes deep into the machinery that makes async work. You will see the event loop, the difference between the macrotask and microtask queues, how to predict tricky output ordering, how microtasks can starve the loop, and how to offload heavy work to worker threads. The final section covers async iteration and streaming: async generators, hand-built async iterators, backpressure, merging streams with clean early exit, and a complete end-to-end async pipeline with bounded concurrency. The course closes with a run of conceptual lectures that turn syntax into judgment: spotting async race conditions, recognizing common anti-patterns, designing an error-handling strategy across a whole codebase, reasoning about performance and memory, and looking ahead to the future of async JavaScript. Examples throughout use vivid, memorable scenarios so the ideas stick, while the underlying lessons map directly to the servers, UIs, and data pipelines you build at work.