https://github.com/theworkflow/sample-worker-queue
Sample worker queue
https://github.com/theworkflow/sample-worker-queue
Last synced: 11 months ago
JSON representation
Sample worker queue
- Host: GitHub
- URL: https://github.com/theworkflow/sample-worker-queue
- Owner: theworkflow
- License: mit
- Created: 2017-05-04T19:53:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-04T20:03:40.000Z (about 9 years ago)
- Last Synced: 2024-10-18T06:42:36.210Z (over 1 year ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# worker-queue
[][version]
[][build]
[][license]
Small sample queuing system implementation.
## Install
`$ npm install worker-queue`
## Usage
```javascript
const queue = require('worker-queue')
const worker = (data, done) => {
// handle data
done(null, data)
}
const notifier = () => console.log('all jobs completed')
const options = { concurrency: 1, notifier }
const client = queue(worker, options)
client.push({ test: true }, (err, result) => {
// do something
})
```
## License
[MIT](LICENSE.md)
[version]: https://www.npmjs.com/package/worker-queue
[build]: https://travis-ci.org/theworkflow/sample-worker-queue
[license]: https://raw.githubusercontent.com/theworkflow/sample-worker-queue/master/LICENSE