bee-queue-scheduler
v0.1.1
Published
a simple cron scheduler for bee-queue
Downloads
53
Readme
Overview
a simple cron scheduler for bee-queue
Installation
yarn add bee-queue-scheduler
Usage
const Queue = require('bee-queue-scheduler');
const queue = new Queue('example');
const job = queue.createJob({x: 2, y: 3})
// job.save();
// simply use schedule method instead of save. that's all!
job.schedule('*/10 * * * * *', 'Asia/Seoul')
// Process the job every 10 seconds
queue.process(function (job, done) {
console.log(`Processing job ${job.id}`);
return done(null, job.data.x + job.data.y);
});