Kue multiple queues for different user groups

279 Views Asked by At

Hi so i'm using the priority scheduler Kue https://github.com/Automattic/kue

What I need is the scheduler to process one job at a time based on the project name. So the code should look something similar to

jobs.create(item.project.name); //Adding a job to the queue

jobs.process(item.project.name, 1, function ( job, done ){
  //Processing the job here
});

The problem is I don't know the name until the users makes a post request

router.post('/add-to-queue',req,res)

And processing and saving in the same function does not work.

Any help would be greatly appreciated.

0

There are 0 best solutions below