delayed-open-queue
v0.1.0
Published
Delayed open for Node.js, based on a queue
Downloads
4
Readme
delayed-open-queue
Delayed open for Node.js, based on a queue
var queue = require('delayed-open-queue')()
queue.push(function (cb) {
console.log('first')
process.nextTick(cb)
})
queue.push(function (cb) {
console.log('second')
process.nextTick(cb)
})
queue.push(function (cb) {
console.log('third')
process.nextTick(cb)
})
console.log('all jobs inserted')
console.log('queue started', queue.started)
console.log('queue completed', queue.completed)
process.nextTick(function () {
console.log('queue started', queue.started)
console.log('queue completed', queue.completed)
})
queue.on('complete', function () {
console.log('all tasks completed')
console.log('queue started', queue.started)
console.log('queue completed', queue.completed)
})
License
MIT