Created
July 2, 2013 17:42
-
-
Save soldair/5911432 to your computer and use it in GitHub Desktop.
what i do instead of using the "async" module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// do series or exactly N parallel its the same | |
var c = jobs.length | |
, job = function(){ | |
doThing(function(){ | |
next() | |
}) | |
}, next = function(){ | |
c--; | |
if(!c) done(); | |
else job() | |
}, done = function(){ | |
cb() | |
}; | |
job(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment