Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added: queue

  • Loading branch information...
commit b28fc24b55fc0ce38019257bdc32568e7fed56ac 1 parent 629e970
@bu authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 async.queue.js
View
18 async.queue.js
@@ -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);
+}
Please sign in to comment.
Something went wrong with that request. Please try again.