Open snig-b opened 8 years ago
@snig-b kue stores your job data in redis, and redis doesn't know about JavaScript classes. You could do something like this:
job.process(jobType, function(job, done) {
var processor = self['get'+job.class](job);
processor.process(done);
});
job.create(jobType, { class: 'GraphLoader', source: source });
I want to pass an object created before creating the job, and a class to the job's data. That job is generic and would be working on multiple classes depending on properties passed to the job. I do not want to hard code the class names in my job processing. But the job process that I have written, does not receive class and method values, the whole key-value pair is missing from job.data. All other simple key-value pairs are present.
Example:
What my job.data includes:
As is visible, the class key-value pair is missing. And the object's key value pair simply is an object with the object's attribute, not the actual object!
How do I find a solution for this?