Last active
December 23, 2015 01:39
-
-
Save navneetkumar/6561689 to your computer and use it in GitHub Desktop.
Use of javascript queue for long-running tasks
This file contains hidden or 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
//avoid zombie objects | |
app.views.home = app.views.home || new app.views.Home() | |
//Use queue for executing long-running tasks | |
var queue = async.queue(function (task, callback) { | |
console.log('started ' + task.name); | |
callback(); | |
}, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment