Chapter 4Flow Control with Async.js

Up to this point, this book has been about using abstractions to manage async tasks throughout an application. PubSub, for instance, is an abstraction that lets us distribute events from their source to other layers of the application (e.g., from the view to the model). Promises are an abstraction that let us represent simple tasks with objects that can be combined to represent complex tasks. Together, these abstractions go a long way toward helping us solve the problem of callback spaghetti.

There’s still one weak spot in our armor, though: iteration. What do we do when we need to perform a series of I/O operations, either in series or in parallel? This is such a common problem in the Node world that ...

Get Async JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.