Repository URL to install this package:
|
Version:
3.1.8 ▾
|
| src |
| package.json |
| README.md |
Inhouse devops job queue
Create a class which extends the base Job class. See the job examples in test/jobs
const JobQueue = require('@fbinhouse/devops-job-queue'); // Create a database object let db = new JobQueue.Database('mongodb://localhost:27017/jobqueue'); // Create a queue specifying the location of the job files let theQueue = new JobQueue.Queue(db, path.join(__dirname, 'jobs')); // Start processing the queue theQueue.start(); // Append a job to the queue theQueue.queueJob('queueName', 'jobName', { params: 'go_here' }).then(jobId => { console.log('Queued up job', jobId); }); // Shutdown the queue gracefully theQueue.stop().then(done => { console.log('Queue is now shutdown'); process.exit(0); });
To include or publish, you need to setup the fbinhouse gem fury repository. This is a one time thing.
npm login --registry="https://npm.fury.io/fbinhouse/" --scope=@fbinhouse
npm test