DEFINITELY DON'T USE THIS. It looks like I probably reinvented the wheel here. I could have just shoved the new jobs into redis and monitored them... See here.
When you're using Kue to process jobs in a separate process, you can't simply execute a callback when the job is finished. This is an example of communication between the two processes.
I would have liked to have used the
id that Kue provides each job automatically (which I believe is the same
id it receives in Redis) but app.js needs to know the
id of the job before it gets sent to the worker so that it can match the
id when it receives a message.
Please let me know if you have a better idea on how to solve the issue or if you can improve my code.