egg-delayed-job
A priority job queue backed by redis, built for eggjs.
Install
$ npm i egg-delayed-job --save
Usage
exports.delayedJob = {
enable: true,
package: 'egg-delayed-job',
};
Configuration
'use strict';
exports.delayedJob = {
client: {
queuePrefix: 'q',
redis: {
port: 6379,
host: '127.0.0.1',
auth: '',
db: 3,
options: {
},
},
},
};
see config/config.default.js for more detail.
Example
app.delayedJob.process('email', (job, done) => {
email(job.data.to, done);
});
app.delayedJob.create('email', {
title: 'welcome email for justin'
, to: 'gdjyluxiaoyong@gmail.com'
, template: 'welcome-email'
}).save();
form more config please see here
Questions & Suggestions
Please open an issue here.
License
MIT