Skip to content

Commit

Permalink
Added new example for new forEachAsync behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
beatgammit committed Apr 2, 2011
1 parent 01afad6 commit dba873d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/forEachAsync.js
@@ -0,0 +1,22 @@
// Testing functionality
(function () {
"use strict";

var forEachAsync = require('futures').forEachAsync,
count = 0,
timers = [
101,
502,
203,
604,
105
],
sequence;

forEachAsync(timers, function (next, time) {
console.log(count += 1, time);
setTimeout(next, time);
}).then(function (next) {
console.log("All Done");
});
}());

0 comments on commit dba873d

Please sign in to comment.