Currently, only the job payload is passed to the handle() method of a job class, I think it could be better to inject the job object and the done() callback too in order to have the same abilities as the default kue API (cf queue.process() method).
You probably want to provide an higher level API in the job classes, but sometime you need to use job.progress() or job.log() inside the job handler, or use the done() callback to return job specific errors, or complete the job programmatically.
Currently, only the job payload is passed to the
handle()method of a job class, I think it could be better to inject the job object and thedone()callback too in order to have the same abilities as the default kue API (cfqueue.process()method).You probably want to provide an higher level API in the job classes, but sometime you need to use
job.progress()orjob.log()inside the job handler, or use thedone()callback to return job specific errors, or complete the job programmatically.