Async.js Talk for Joint Node.DC / DC jQuery Meetup

 DC Node/jQuery Presentation

I gave the following presentation on Async.js to a combined Node.DC and DC jQuery meetup on Feb. 20, 2012.

The full presentation is available on GitHub, and uses the Impress.js CSS3-based presentation framework. Consequently, it might not render well in older browsers and IE.

Better JavaScript Control Flow with Async.js

Async.js is a control flow library for the browser and Node.js. It is a wonderful tool for taming parallel, serial and dependency graph-like combinations of asynchronous callbacks. Put another way, if this nested-callback pattern looks familiar:

fun1(params, function (err, results) {
  fun2(params, function (err, results) {
    fun3(params, function (err, results) {
      fun4(params, function (err, results) {
        fun5(params, function (err, results) {
          fun6(params, function (err, results) {
            // Do something interesting here.
          });
        });
      });
    });
  });
});

then Async.js might just be your solution.

Async.js Features

My talk covers some of Async.js’ most fundamental abstractions:

  • Series
  • Waterfall
  • Parallel
  • Collections

However, there are many, many more functions and helper methods to deal with a diverse array of concurrent / asynchronous development problems, so I strongly encourage a thorough reading of the library’s README to see what’s available and review the great examples provided along with the library.