Skip to content

Instantly share code, notes, and snippets.

@alexbosworth
Created October 25, 2010 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbosworth/645123 to your computer and use it in GitHub Desktop.
Save alexbosworth/645123 to your computer and use it in GitHub Desktop.
Asynchronous Patterns For Node.JS
** Steps **
Problem:
Map asynchronous callbacks onto a multi-step process.
Centralize flow logic
object {
steps : [function, function, function]
advance : function() { this.shift(function)(); }
}
Call the advance method on the object when the function completes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment