Permalink
Browse files

added: queue

  • Loading branch information...
1 parent 629e970 commit b28fc24b55fc0ce38019257bdc32568e7fed56ac @bu committed Feb 6, 2013
Showing with 18 additions and 0 deletions.
  1. +18 −0 async.queue.js
View
@@ -0,0 +1,18 @@
+var async = require("async");
+
+var queue = async.queue(function(job, callback) {
+ console.log(job);
+
+ setTimeout(callback, 500);
+
+}, 2);
+
+var index = 0;
+
+console.log("Start work" + index);
+
+for(var index = 0; index< 100; index++) {
+
+ console.log("ing" + index);
+ queue.push(index);
+}

0 comments on commit b28fc24

Please sign in to comment.