Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mcollina/delayed-open-queue

Delayed open for Node.js, based on a queue
https://github.com/mcollina/delayed-open-queue

Last synced: 13 days ago
JSON representation

Delayed open for Node.js, based on a queue

Awesome Lists containing this project

README

        

# delayed-open-queue

Delayed open for Node.js, based on a queue

```js
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