Skip to content
Back to skills

436 Queue Partitioning 7eb69598

ASecurity

Partitioned queues apply flow control limits per partition key instead of the entire queue. Each partition acts as a dynamic "subqueue".

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
documentationtypescript

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 436-queue-partitioning_7eb69598 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 436 Queue Partitioning 7eb69598?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 436 Queue Partitioning 7eb69598
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-436-queue-partitioning-7eb69598/badge)](https://www.skillsdirectory.com/skills/tools-only-436-queue-partitioning-7eb69598)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
title: Partition Queues for Per-Entity Limits
impact: HIGH
impactDescription: Enables per-entity concurrency control
tags: queue, partition, per-user, dynamic
---

## Partition Queues for Per-Entity Limits

Partitioned queues apply flow control limits per partition key instead of the entire queue. Each partition acts as a dynamic "subqueue".

**Incorrect (global concurrency for per-user limits):**

```typescript
// Global concurrency=1 blocks ALL users, not per-user
const queue = new WorkflowQueue("tasks", { concurrency: 1 });
```

**Correct (partitioned queue):**

```typescript
const queue = new WorkflowQueue("tasks", {
  partitionQueue: true,
  concurrency: 1,
});

async function onUserTask(userID: string, task: string) {
  // Each user gets their own partition - at most 1 task per user
  // but tasks from different users can run concurrently
  await DBOS.startWorkflow(processTask, {
    queueName: queue.name,
    enqueueOptions: { queuePartitionKey: userID },
  })(task);
}
```

**Two-level queueing (per-user + global limits):**

```typescript
const concurrencyQueue = new WorkflowQueue("concurrency-queue", { concurrency: 5 });
const partitionedQueue = new WorkflowQueue("partitioned-queue", {
  partitionQueue: true,
  concurrency: 1,
});

// At most 1 task per user AND at most 5 tasks globally
async function onUserTask(userID: string, task: string) {
  await DBOS.startWorkflow(concurrencyManager, {
    queueName: partitionedQueue.name,
    enqueueOptions: { queuePartitionKey: userID },
  })(task);
}

async function concurrencyManagerFn(task: string) {
  const handle = await DBOS.startWorkflow(processTask, {
    queueName: concurrencyQueue.name,
  })(task);
  return await handle.getResult();
}
const concurrencyManager = DBOS.registerWorkflow(concurrencyManagerFn);
```

Reference: [Partitioning Queues](https://docs.dbos.dev/typescript/tutorials/queue-tutorial#partitioning-queues)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…