worker-queue
v0.1.1
Published
Process jobs in parallel based on concurrency
Downloads
4
Readme
worker-queue
Small sample queuing system implementation.
Install
$ npm install worker-queue
Usage
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
})