You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/queue-concurrency.mdx
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,6 +174,8 @@ export async function POST(request: Request) {
174
174
To bound the whole queue, set `combinedConcurrencyLimit`. Each key still gets at most `concurrencyLimit`, and the queue as a whole never exceeds the combined limit across all keys:
A gate without a `concurrencyKey` uses the run's own key. Declare a shared queue and gate every relevant task on it, and each tenant gets one cap spanning all of those tasks:
209
211
210
212
```ts /trigger/webhooks.ts
213
+
import { queue, task } from"@trigger.dev/sdk";
214
+
211
215
//each tenant runs at most 10 at once across every task that gates on this queue
@@ -232,6 +236,8 @@ Because the trigger passes a `concurrencyKey`, the home queue splits per key as
232
236
To cap something global, like total traffic to an external API, across many tasks and all tenants: declare a queue with only a `combinedConcurrencyLimit` and gate on it. Tenant keys still split the gate into per-key pools, but with no per-key limit the combined cap is the only constraint:
233
237
234
238
```ts /trigger/sync.ts
239
+
import { queue, task } from"@trigger.dev/sdk";
240
+
235
241
//at most 10 concurrent provider calls across every task and every tenant
0 commit comments