Please Star on GitHub / NPM and Watch for updates.
- Powered by RethinkDB
- Connect to multiple databases
- Create multiple queues
- Distributed worker nodes (PubSub)
- Global queue events
- Global job cancellation
- Global pause queue
- Run concurrent jobs
- Promise based with minimal callbacks
- Priority processing of jobs
- Job progress updates
- Delayed job start
- Find jobs in the queue
- Determine job uniqueness
- Job timeout
- Retrying failed jobs
- Repeatable jobs
- Job reanimation
- Job Editing
- Rich job history log
- TypeScript definitions included
- Over 2000 integration tests
Note: You will need to install RethinkDB before you can use
npm install rethinkdb-job-queue --save
See the installation document for supported Node.js versions and workarounds.
const Queue =const qOptions =name: 'Mathematics' // The queue and table nameconst cxnOptions =db: 'JobQueue' // The name of the database in RethinkDBconst q = cxnOptions qOptionsconst job = qqreturn q
// The following is not related to rethinkdb-job-queue.// This is the nodemailer configurationconst nodemailer =const transporter = nodemailer// Setup e-mail data with unicode symbolsvar mailOptions =from: '"Registration" <firstname.lastname@example.org>' // Sender addresssubject: 'Registration' // Subject linetext: 'Click here to complete your registration' // Plaintext bodyhtml: '<b>Click here to complete your registration</b>' // HTML body// rethinkdb-job-queue configurationconst Queue =// Queue options have defaults and are not requiredconst qOptions =name: 'RegistrationEmail' // The queue and table namemasterInterval: 310000 // Database review period in millisecondschangeFeed: true // Enables events from the database tableconcurrency: 100removeFinishedJobs: 2592000000 // true, false, or number of milliseconds// Connection options have defaults and are not required// You can replace these options with a rethinkdbdash driver objectconst cxnOptions =host: 'localhost'port: 28015db: 'JobQueue' // The name of the database in RethinkDB// This is the main queue instantiation callconst q = cxnOptions qOptions// Customizing the default job options for new jobsqjobOptions =priority: 'normal'timeout: 300000retryMax: 3 // Four attempts, first then three retriesretryDelay: 600000 // Time in milliseconds to delay retriesconst job = q// The createJob method will only create the job locally.// It will need to be added to the queue.// You can decorate the job with any data to be saved for processingjobrecipient = 'email@example.com'qreturn q
About the Owner
I, Grant Carthew, am a technologist, trainer, and Dad from Queensland, Australia. I work on code in a number of personal projects and when the need arises I build my own packages.
This project exists because there were no functional job queues built on the RethinkDB database. I wanted an alternative to the other job queues on NPM.
Everything I do in open source is done in my own time and as a contribution to the open source community.
If you are using my projects and would like to thank me or support me, please click the Patreon link below.
See my other projects on NPM.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Want to help but not sure how? Checkout the ideas page.
Thanks to the following marvelous packages and people for their hard work:
- The RethinkDB team for the great database.
- The RethinkDB driver rethinkdbdash by Michel
- The Promise library Bluebird by Petka Antonov.
- The uuid package.
This list could go on...