Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/PaulJPhilp/EffectPatternsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/pauljphilp/effectpatterns/concurrency-pattern-4-distribute-work-with-queue)<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/concurrency-pattern-4-distribute-work-with-queue"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/concurrency-pattern-4-distribute-work-with-queue/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/concurrency-pattern-4-distribute-work-with-queue"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/concurrency-pattern-4-distribute-work-with-queue.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01208 | $0.01208 |
| Opus 5.5 | $0.00483 | $0.00483 |
| Sonnet 5.5 | $0.00242 | $0.00242 |
| Haiku 4.5 | $0.00121 | $0.00121 |
Grade A, and why
concurrency-pattern-4-distribute-work-with-queue scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Use Queue to distribute work between producers and consumers with built-in backpressure, enabling flexible pipeline coordination. globs: "**/*.ts" alwaysApply: true
Concurrency Pattern 4: Distribute Work with Queue
Rule: Use Queue to distribute work between producers and consumers with built-in backpressure, enabling flexible pipeline coordination.
Example
This example demonstrates a producer-consumer pipeline with a bounded queue for buffering work items.
import { Effect, Queue, Fiber, Ref } from "effect";
interface WorkItem {
readonly id: number;
readonly data: string;
readonly timestamp: number;
}
interface WorkResult {
readonly itemId: number;
readonly processed: string;
readonly duration: number;
}
// Producer: generates work items
const producer = (
queue: Queue.Enqueue<WorkItem>,
count: number
): Effect.Effect<void> =>
Effect.gen(function* () {
yield* Effect.log(`[PRODUCER] Starting, generating ${count} items`);
for (let i = 1; i <= count; i++) {
const item: WorkItem = {
id: i,
data: `Item ${i}`,
timestamp: Date.now(),
};
const start = Date.now();
// Enqueue - will block if queue is full (backpressure)
yield* Queue.offer(queue, item);
const delay = Date.now() - start;
if (delay > 0) {
yield* Effect.log(
`[PRODUCER] Item ${i} enqueued (waited ${delay}ms due to backpressure)`
);
} else {
yield* Effect.log(`[PRODUCER] Item ${i} enqueued`);
}
// Simulate work
yield* Effect.sleep("50 millis");
}
yield* Effect.log(`[PRODUCER] ✓ All items enqueued`);
});
// Consumer: processes work items
const consumer = (
queue: Queue.Dequeue<WorkItem>,
consumerId: number,
results: Ref.Ref<WorkResult[]>
): Effect.Effect<void> =>
Effect.gen(function* () {
yield* Effect.log(`[CONSUMER ${consumerId}] Starting`);
while (true) {
// Dequeue - will block if queue is empty
const item = yield* Queue.take(queue).pipe(Effect.either);
if (item._tag === "Left") {
yield* Effect.log(`[CONSUMER ${consumerId}] Queue closed, stopping`);
return;
}
const workItem = item.right;
const startTime = Date.now();
yield* Effect.log(
`[CONSUMER ${consumerId}] Processing ${workItem.data}`
);
// Simulate processing
yield* Effect.sleep("150 millis");
const duration = Date.now() - startTime;
const result: WorkResult = {
itemId: workItem.id,
processed: `${workItem.data} [processed by consumer ${consumerId}]`,
duration,
};
yield* Ref.update(results, (rs) => [...rs, result]);
yield* Effect.log(
`[CONSUMER ${consumerId}] ✓ Completed ${workItem.data} in ${duration}ms`
);
}
});
// Main: coordinate producer and consumers
const program = Effect.gen(function* () {
// Create bounded queue with capacity 3
const queue = yield* Queue.bounded<WorkItem>(3);
const results = yield* Ref.make<WorkResult[]>([]);
console.log(`\n[MAIN] Starting producer-consumer pipeline with queue size 3\n`);
// Spawn producer
const producerFiber = yield* producer(queue, 10).pipe(Effect.fork);
// Spawn 2 consumers
const consumer1 = yield* consumer(queue, 1, results).pipe(Effect.fork);
const consumer2 = yield* consumer(queue, 2, results).pipe(Effect.fork);
// Wait for producer to finish
yield* Fiber.join(producerFiber);
// Give consumers time to finish
yield* Effect.sleep("3 seconds");
// Close queue and wait for consumers
yield* Queue.shutdown(queue);
yield* Fiber.join(consumer1);
yield* Fiber.join(consumer2);
// Summary
const allResults = yield* Ref.get(results);
const totalDuration = allResults.reduce((sum, r) => sum + r.duration, 0);
console.log(`\n[SUMMARY]`);
console.log(` Items processed: ${allResults.length}`);
console.log(
` Avg processing time: ${Math.round(totalDuration / allResults.length)}ms`
);
});
Effect.runPromise(program);
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 175 lines · 1,208 tokens per session scan A 6c4a3c6015e7
concurrency-pattern-4-distribute-work-with-queue is a cursor rule published in the GitHub repository PaulJPhilp/EffectPatterns (807 stars, last pushed 5mo ago), licensed MIT. It adds 1,208 tokens to every session, about $0.0048 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
concurrency-pattern-4-distribute-work-with-queue compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| concurrency-pattern-4-distribute-work-with-queuePaulJPhilp/EffectPatterns | Cursor rule | 807 | 5mo ago | MIT | A | 1,208 | Cursor |
| fastapi-components-and-validationWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 64 | Cursor |
| accessibilityWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| verify-information-ruleWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 46 | Cursor |
| new-user-experience-nux-flow-ruleWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 0 | Cursor |
| globalexceptionhandler-classWebDevPeterGriffin/The-VibeCode-Bible | Cursor rule | 42 | 26d ago | none | A | 27 | Cursor |
| ponytailDietrichGebert/ponytail | Cursor rule | 201k | 8d ago | MIT | A | 604 | Cursor |