egg-queue-bull
Provide job queue for egg, powered by Bull
Install
$ npm i egg-queue-bull --save
Usage
exports.queue = {
enable: true,
package: 'egg-queue-bull',
};
Configuration
exports.queue = {
delegate: 'queue',
baseDir: 'queue',
};
exports.bull = {
clients: {
q1: { name: 'q1' },
q2: { name: 'q2' },
},
default: {
redis: {
port: 6379,
host: '127.0.0.1',
},
},
};
Please see Bull for more detail.
Example
module.exports = app => {
const queue = app.bull.get('videoQueue');
queue.process((job, done) => {
job.progress(42);
done();
});
return queue;
};
exports.index = function* (ctx) {
yield ctx.queue.video.add({ video: 'http://example.com/video1.mov' });
};
Questions & Suggestions
Please open an issue here.
License
MIT