Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 438 Bytes

lifo.md

File metadata and controls

16 lines (11 loc) · 438 Bytes
description
Last-in, First Out

LIFO

In some cases, it is useful to process the jobs in a LIFO (Last-in, First-Out) fashion. This means that the newest jobs added to the queue will be processed before the older ones.

import { Queue } from 'bullmq';

const myQueue = new Queue('Paint');

// Add a job that will be processed before all others
await myQueue.add('wall', { color: 'pink' }, { lifo: true });