Prioritized
import { Queue } from 'bullmq';
const myQueue = new Queue('Paint');
await myQueue.add('wall', { color: 'pink' }, { priority: 10 });
await myQueue.add('wall', { color: 'brown' }, { priority: 5 });
await myQueue.add('wall', { color: 'blue' }, { priority: 7 });
// The wall will be painted first brown, then blue and
// finally pink.Change priority
const job = await Job.create(queue, 'test2', { foo: 'bar' }, { priority: 16 });
await job.changePriority({
priority: 1,
});Get Prioritized jobs
Get Counts per Priority
Read more:
Last updated
Was this helpful?