Created
December 8, 2011 11:23
-
-
Save mlegenhausen/1446757 to your computer and use it in GitHub Desktop.
Chain-Gang Issue #7
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
var chainGang = require('chain-gang'); | |
var queue = chainGang.create(); | |
var longTask = function(text) { | |
return function(worker) { | |
setTimeout(function() { | |
console.log(text); | |
worker.finish(); | |
}, 1000); | |
} | |
}; | |
queue.add(longTask('Hello World')); | |
queue.add(longTask('Nothing will happen')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment