Skip to content

Instantly share code, notes, and snippets.

@navneetkumar
Last active December 23, 2015 01:39
Show Gist options
  • Save navneetkumar/6561689 to your computer and use it in GitHub Desktop.
Save navneetkumar/6561689 to your computer and use it in GitHub Desktop.
Use of javascript queue for long-running tasks
//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