发布于 2016-02-04 21:22:34
首先,Kue提供了一些好的事件:
https://github.com/Automattic/kue#queue-events
queue.on('job enqueue', function(id, type){
console.log( 'Job %s got queued of type %s', id, type );
});但是,从您的问题看,您不仅希望收到队列中作业的通知,而且还希望在这些作业进入队列时对它们进行。
https://github.com/Automattic/kue#processing-jobs
queue.process('email', function(job, done){
// do something with job.data
// callback to done
email(job.data.to, done);
});https://stackoverflow.com/questions/35193068
复制相似问题