Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/mcollina/delayed-open-queue
- Owner: mcollina
- License: mit
- Created: 2016-05-02T13:28:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-02T14:10:05.000Z (over 8 years ago)
- Last Synced: 2024-12-17T15:43:21.752Z (23 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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