I am implementing redis queue with Kue in my nodejs app. I have an API which will add email jobs
to an email queue
. Is it a good practice to have a cron job listening to the redis
email queue
for new jobs or is there a way by which an event is fired from the node.js
app when a new email job
is entered and caught from a separate node.js
app to process it. I'm a little confused on the right approach.
How to get notified when a new job in redis is added
346 Views Asked by Jaseem Abbas At
1
First, there are good events supplied by Kue:
https://github.com/Automattic/kue#queue-events
However, it seems from your question that you don't only want to be notified of jobs in the queue but instead you want to process these jobs as they are enqueued.
https://github.com/Automattic/kue#processing-jobs