async

ModuleIsomorphic

Utility functions for asynchronous operations

This module provides a collection of functions for dealing with callbacks and logical dependencies in asynchronous code.

Documentation

asyncjoincallbackfunction...callbackany...stepnextargToNextany...argFromPrevany......onceinitdonevalueanycallbackvalueany

Utilities for asynchronous applications. join executes all but its last function argument, which it calls when the previous functions have all executed the given callback, and to which it passes in the Arguments object (or arguments[0] if arguments.length is 1) from each of the previous functions' calls in order.

step executes the given functions in sequence with a next callback function and any arguments passed in from the previous function's call to next.

once returns a function that executes the init function once and buffers subsequent calls. When init has issued its done callback, all buffered callbacks will be issued (along with the value argument, if any, provided by init). Additional calls to the buffering function will execute callback immediately.