All Projects → grantcarthew → Node Rethinkdb Job Queue

grantcarthew / Node Rethinkdb Job Queue

Licence: mit
A persistent job or task queue backed by RethinkDB.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Rethinkdb Job Queue

Xxl Job
A distributed task scheduling framework.(分布式任务调度平台XXL-JOB)
Stars: ✭ 20,197 (+12682.91%)
Mutual labels:  task, job, distributed
qless-php
PHP Bindings for qless
Stars: ✭ 25 (-84.18%)
Mutual labels:  task, queue, message
Je
A distributed job execution engine for the execution of batch jobs, workflows, remediations and more.
Stars: ✭ 30 (-81.01%)
Mutual labels:  task, job, distributed
rearq
A distributed task queue built with asyncio and redis, with built-in web interface
Stars: ✭ 81 (-48.73%)
Mutual labels:  task, queue, distributed
Ytask
YTask is an asynchronous task queue for handling distributed jobs in golang(go异步任务框架)
Stars: ✭ 121 (-23.42%)
Mutual labels:  task, job, queue
linda
Linda is a simple dispatcher library.
Stars: ✭ 12 (-92.41%)
Mutual labels:  task, queue, job
leek
Celery Tasks Monitoring Tool
Stars: ✭ 77 (-51.27%)
Mutual labels:  task, queue, distributed
Clearly
Clearly see and debug your celery cluster in real time!
Stars: ✭ 287 (+81.65%)
Mutual labels:  task, queue, distributed
Bull
Premium Queue package for handling distributed jobs and messages in NodeJS.
Stars: ✭ 11,748 (+7335.44%)
Mutual labels:  job, queue, message
Appserver
A multithreaded application server for PHP, written in PHP.
Stars: ✭ 930 (+488.61%)
Mutual labels:  queue, message
Quedis
Quedis - redis queue for bosses
Stars: ✭ 31 (-80.38%)
Mutual labels:  queue, message
Tossit
Library for distributed job/worker logic.
Stars: ✭ 56 (-64.56%)
Mutual labels:  job, distributed
Taskmanager
A simple、 light(only two file)、fast 、powerful 、easy to use 、easy to extend 、 Android Library To Manager your AsyncTask/Thread/CallBack Jobqueue ! 一个超级简单,易用,轻量级,快速的异步任务管理器,类似于AsyncTask,但是比AsyncTask更好用,更易控制,从此不再写Thread ! ^_^
Stars: ✭ 25 (-84.18%)
Mutual labels:  task, job
Npm Build Boilerplate
A collection of packages that build a website using npm scripts.
Stars: ✭ 963 (+509.49%)
Mutual labels:  task, npm
Fennel
A task queue library for Python and Redis
Stars: ✭ 24 (-84.81%)
Mutual labels:  task, queue
Listr2
NodeJS Task List derived from the best! Create beautiful CLI interfaces via easy and logical to implement task lists that feel alive and interactive.
Stars: ✭ 73 (-53.8%)
Mutual labels:  task, npm
Miniqueue
A simple, single binary, message queue.
Stars: ✭ 77 (-51.27%)
Mutual labels:  queue, message
Inc.runtime.queue
An runtime queue use Asynchronous program
Stars: ✭ 19 (-87.97%)
Mutual labels:  task, queue
Bokeh
Bokeh is a simple, scalable and blazing-fast task queue built on Node.js and ZeroMQ.
Stars: ✭ 67 (-57.59%)
Mutual labels:  queue, message
Xa
Beautiful & Customizable logger ❤️
Stars: ✭ 78 (-50.63%)
Mutual labels:  message, npm

Introduction

rethinkdb-job-queue is a persistent job or task queue backed by RethinkDB. It has been built as an alternative to the many queues available on NPM.

bitHound Overall Score bitHound Dependencies bitHound Dependencies js-standard-style NSP Status Patreon Donation

Thinker

NPM

Please Star on GitHub / NPM and Watch for updates.

Features

Documentation

Quick Start

Installation

Note: You will need to install RethinkDB before you can use rethinkdb-job-queue.

npm install rethinkdb-job-queue --save

See the installation document for supported Node.js versions and workarounds.

Simple Example

const Queue = require('rethinkdb-job-queue')
const qOptions = {
  name: 'Mathematics' // The queue and table name
}
const cxnOptions = {
  db: 'JobQueue', // The name of the database in RethinkDB
}

const q = new Queue(cxnOptions, qOptions)

const job = q.createJob({
  numerator: 123,
  denominator: 456
})

q.process((job, next) => {
    try {
      let result = job.numerator / job.denominator
      // Do something with your result
      return next(null, result)
    } catch (err) {
      console.error(err)
      return next(err)
    }
})

return q.addJob(job).catch((err) => {
  console.error(err)
})

E-Mail Job Example using nodemailer

// The following is not related to rethinkdb-job-queue.
// This is the nodemailer configuration
const nodemailer = require('nodemailer')
const transporter = nodemailer.createTransport({
  service: 'Mailgun',
  auth: {
    user: '[email protected]',
    pass: 'your-api-key-here'
  }
})

// Setup e-mail data with unicode symbols
var mailOptions = {
  from: '"Registration" <[email protected]>', // Sender address
  subject: 'Registration', // Subject line
  text: 'Click here to complete your registration', // Plaintext body
  html: '<b>Click here to complete your registration</b>' // HTML body
}

// rethinkdb-job-queue configuration
const Queue = require('rethinkdb-job-queue')

// Queue options have defaults and are not required
const qOptions = {
  name: 'RegistrationEmail', // The queue and table name
  masterInterval: 310000, // Database review period in milliseconds
  changeFeed: true, // Enables events from the database table
  concurrency: 100,
  removeFinishedJobs: 2592000000, // true, false, or number of milliseconds
}

// Connection options have defaults and are not required
// You can replace these options with a rethinkdbdash driver object
const cxnOptions = {
  host: 'localhost',
  port: 28015,
  db: 'JobQueue', // The name of the database in RethinkDB
}

// This is the main queue instantiation call
const q = new Queue(cxnOptions, qOptions)

// Customizing the default job options for new jobs
q.jobOptions = {
  priority: 'normal',
  timeout: 300000,
  retryMax: 3, // Four attempts, first then three retries
  retryDelay: 600000 // Time in milliseconds to delay retries
}

const job = q.createJob()
// 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 processing
job.recipient = '[email protected]'

q.process((job, next) => {
  // Send email using job.recipient as the destination address
  mailOptions.to = job.recipient
  return transporter.sendMail(mailOptions).then((info) => {
    console.dir(info)
    return next(null, info)
  }).catch((err) => {
    // This catch is for nodemailer sendMail errors.
    return next(err)
  })
})

return q.addJob(job).then((savedJobs) => {
  // savedJobs is an array of the jobs added with updated properties
}).catch((err) => {
  console.error(err)
})

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.

Patreon Donation

See my other projects on NPM.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Want to help but not sure how? Checkout the ideas page.

Please see the debugging and testing documents for more detail.

Credits

Thanks to the following marvelous packages and people for their hard work:

This list could go on...

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].