Skip to content

Does trigger.dev support priority queue? #503

Answered by matt-aitken
offchan42 asked this question in Q&A
Discussion options

You must be logged in to vote

In v3 we have more concurrency controls. You can define queues and attach them to Jobs (including sharing them across Jobs, which is what you need to do for your use case). Then when you trigger the Job you can specify a concurrencyKey – that will effectively create a copy of that queue with that key.

To be more concrete:

const serialTenantQueue = queue({
  name: "serial-tenant-queue",
  concurrencyLimit: 1,
});

export const subscriptionCheck = task({
  id: "subscription-check",
  queue: serialTenantQueue,
  run: async ({ payload }: { payload: number }) => {
    return "something";
  },
});

export const productData = task({
  id: "product-data",
  queue: serialTenantQueue,
  run: async ({

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by offchan42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants