liquidautumn / bull-jobs-worker

A boilerpalte for building Bull job-queue worker based on Redis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bull-jobs-worker

JavaScript Style Guide

A boilerpalte for building Bull job-queue worker based on Redis

Features

  • ES6/ES2015 support using Babel
  • Use Bull job manager for persistent job and message queue based on Redis
  • Use Toureiro to provide web interface for administration of the queues
  • Use nodemon for watching and restarting in development environment
  • Use Jest as test framework

Structure

.
├── bin
│   └── worker.js        # entry of worker
├── src
│   ├── config           # app configurations
│   │   ├── env          # environment variable definitions
│   │   ├── config.js    # configuration variables
│   │   └── index.js     # entry of configuration
│   │── jobs             # job queue and process implementations
│   └── app.js           # application entry
├── test                 # testing scripts
└── package.json

Usage

Requirements

Bull requires a Redis version greater than or equal to 2.8.11.

Setup

$ npm install

Run for development

Create a job file in folder src/jobs.

$ npm run dev -- -j [JOB_FILE_NAME]

Run for production

Run a job.

$ npm start -- -- -j [JOB]

Run multiple jobs.

$ npm start -- -- -j [JOB1,JOB2,...]

Run Toureiro for monitoring jobs.

$ npm start -- -- -u -p [port]

Testing

$ npm test

References

License

MIT © Chun-Kai Wang

About

A boilerpalte for building Bull job-queue worker based on Redis

License:MIT License


Languages

Language:JavaScript 100.0%