원클릭으로
effect-ts-concurrency
Use when performing parallel operations, rate limiting, or signaling between fibers in Effect-TS.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when performing parallel operations, rate limiting, or signaling between fibers in Effect-TS.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | effect-ts-concurrency |
| description | Use when performing parallel operations, rate limiting, or signaling between fibers in Effect-TS. |
| version | 1.0.0 |
Effect-TS provides lightweight fibers for high-performance concurrency. The core principle is explicit control: always bound parallelism to prevent resource exhaustion.
Effect.all, Effect.forEach)When NOT to use:
Promise.all is sufficient (though Effect is usually preferred for consistency)Unbounded parallelism is the most common source of "Too many open files" or "Connection timeout" errors.
| Pattern | Implementation | Result |
|---|---|---|
| BAD | Effect.all(effects) | Unbounded - crashes on large inputs |
| GOOD | Effect.all(effects, { concurrency: 10 }) | Bounded - safe and predictable |
| Tool | Purpose | Key Method |
|---|---|---|
| Fiber | Background execution | Effect.fork / Fiber.join |
| Semaphore | Bounded concurrency / Rate limiting | semaphore.withPermits(n) |
| Deferred | One-shot signaling / Promises | Deferred.await / Deferred.succeed |
| concurrency | Option for all, forEach, mapEffect | `{ concurrency: number |
Always specify concurrency when processing collections.
import { Effect } from 'effect';
// Process 1000 items, max 10 concurrent
const results = yield* Effect.all(
items.map(processItem),
{ concurrency: 10 }
);
Use a Semaphore when multiple independent operations must share a global limit.
import { Effect } from 'effect';
const program = Effect.gen(function* () {
const semaphore = yield* Effect.makeSemaphore(5); // Max 5 concurrent
yield* Effect.all(
requests.map((req) =>
semaphore.withPermits(1)(handleRequest(req))
),
{ concurrency: 'unbounded' } // Semaphore controls actual concurrency
);
});
Use Deferred to wait for a specific event or value from another fiber.
import { Deferred, Effect, Fiber } from 'effect';
const program = Effect.gen(function* () {
const signal = yield* Deferred.make<void>();
const worker = yield* Effect.fork(
Effect.gen(function* () {
yield* Deferred.await(signal); // Wait for signal
yield* doWork();
})
);
yield* setup();
yield* Deferred.succeed(signal, undefined); // Trigger worker
yield* Fiber.join(worker);
});
{ concurrency: n } in Effect.all.Effect.scoped for safety).Effect.all on a large array without { concurrency: n }.Promise.all inside an Effect-TS codebase.setTimeout for rate limiting instead of Effect.makeRateLimiter or Semaphore.| Excuse | Reality |
|---|---|
| "It's only 100 items" | 100 items today, 10,000 tomorrow. Bound it now. |
| "The API is fast" | Network latency and server load are unpredictable. |
| "I'll add concurrency later" | Unbounded parallelism is a ticking time bomb. |
REQUIRED BACKGROUND: See effect-ts-anti-patterns for more on unbounded parallelism.
Use when reviewing Effect-TS code, debugging unexpected crashes, or optimizing concurrent operations.
Use when implementing error handling, validation logic, or custom error types in Effect-TS.
Use when implementing type-safe, composable, and testable applications using Effect-TS, specifically for service definition, dependency injection, and sequential async logic.
Use when managing resource lifecycles (DB connections, file handles, sockets) where cleanup must be guaranteed despite failures, interruptions, or potential resource leaks.