You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be helpful to have additional ways to query jobs other than the job id. For example by user id, group id, batch id, etc.
This would allow jobs to be created, viewed and maintained by individual users, among other things.
Here is how I could envision it working, off the top of my head:
varkue=require('kue');varjobs=kue.createQueue();// creation...jobs.create({// job type/indexestype: 'report',indexes: {user_id: '123'// added to q:indexes:user_id:* set in redis,group_id: 'abc'// added to q:indexes:group_id:* set in redis,batch_id: 'xyz'// added to q:indexes:batch_id:* set in redis// ... etc ...}},{// job payload/datareport_id: 'quarterly_profits',format: 'pdf',orientation: 'L',pageSize: 'Letter',rangeStart: '2013-01-01',deliver_to: 'me@somewhere.com'}).save();// perhaps a better way to handle creation ...jobs.create(...).index({user_id: '123',group_id: 'abc'}).save();// retrieval...// returns all pending jobs which have job ids // indexed under q:indexes:user_id:123Job.find({state: ['delayed','inactive'],user_id: '123'},function(err,foundJobs){if(err){console.log(err);return;}foundJobs.forEach(function(job){// do something interesting});});// stats...// aggregates stats for all jobs indexed for// q:indexes:group_id:abcJob.stats({group_id: 'abc'},function(err,stats){// stats contains state counts, etc for // all jobs belonging to group id 'abc'});
The text was updated successfully, but these errors were encountered:
+1, but first I want to make sure reds indexes are not leaking as before and are a solid base to add more indexing features on top. So can you test and claim that it doesn't leak indexes in heavy concurrent thunders? i.e. when adding, changing state fast, removing jobs?
second, we want index some part of our job data, so it would be more nice to write
👍 on indexing on user-defined job data fields. Seems like a smart way to go.
As for leaks...
I'm fairly new to redis but perhaps everything could be wrapped inside a transaction using MULTI and EXEC? That would ensure that when creating a job, all indexes are guaranteed to be created and when removing a job all indexes are guaranteed to be removed.
It would be helpful to have additional ways to query jobs other than the job id. For example by user id, group id, batch id, etc.
This would allow jobs to be created, viewed and maintained by individual users, among other things.
Here is how I could envision it working, off the top of my head:
The text was updated successfully, but these errors were encountered: