BullMQ Proxy
  • What is BullMQ Proxy
  • Getting started
    • Architecture overview
    • Using Dragonfly
  • HTTP API
    • Authentication
    • Queues
      • Adding jobs
        • Retries
        • Delayed jobs
        • Prioritized
        • Repeatable
        • LIFO
        • Custom Job IDs
      • Getting jobs
      • Queue's actions
      • Reference
    • Workers
      • Endpoints
      • Adding workers
        • Concurrency
        • Rate-Limit
        • Removing finished jobs
        • Stalled jobs
        • Timeouts
      • Removing workers
      • Getting workers
      • Reference
    • Jobs
      • Jobs' actions
        • Update job progress
        • Add job logs
      • Reference
    • Configuration
    • Debugging
Powered by GitBook
On this page
  1. HTTP API
  2. Queues
  3. Adding jobs

LIFO

LIFO stands for Last-In-First-Out. This mode is the oposite of a standard queue, where jobs are processed in the same order as they arrive to the queue. In a LIFO queue the last added job will be processed before existing jobs.

To enable this mode for a given job just pass the "lifo" property and set it to true.

interface JobOpts {
  lifo: boolean;
  // ... More opts
}
curl --location 'http://mydomain.dev/queues/my-queue/jobs' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer my-secret-token' \
--data '[{
	  "name": "paint-black",
          "data": {},
         },
         {
	  "name": "paint-red",
          "data": {},
          "opts": {
            "lifo": true
          }
         } 
]'

In the above snippet, the job named "paint-red" will be processed before "paint-black" as it was added with the lifo option set to true.

PreviousRepeatableNextCustom Job IDs

Last updated 1 year ago