Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
341 changes: 0 additions & 341 deletions designs/GROUP_CONCURRENCY.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/content/api/conductor.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const task = conductor.createTask(
removeOnComplete?: { days: number } | false; // Retention policy
removeOnFail?: { days: number } | false; // Retention policy
batch?: { size: number; timeoutMs: number }; // Batch processing config
deadLetter?: { queue: string; task?: Task }; // Final-failure destination
}
```

Expand Down
8 changes: 7 additions & 1 deletion docs/content/api/orchestrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ const orchestrator = Orchestrator.create({
- `workers`: (optional) Array of custom workers from `conductor.createWorker()`
- `defaultWorker`: (optional) Configuration for default worker

The Orchestrator is the registration authority for its workers. Configure at
most one worker for each queue (including the implicit `default` worker); put
all tasks for a queue on that worker. Multiple workers for one queue are
rejected rather than competing for registrations.

**Default worker config:**

```typescript
Expand Down Expand Up @@ -71,7 +76,8 @@ await orchestrator.drain();
```

- Starts the orchestrator
- Processes until queue is empty
- Processes until all queues are globally quiescent, including event fan-out
created while another queue is finishing
- Automatically stops
- Returns when all work is done

Expand Down
17 changes: 17 additions & 0 deletions docs/content/api/task-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ const task = conductor.createTask(
- Resumes after duration expires
- Execution continues from where it left off

## ctx.waitForEvent()

Wait durably for the next matching custom event. The subscription is persisted before the
worker is released, so a restart does not lose the wait.

```typescript
const event = await ctx.waitForEvent("payment", {
event: paymentReceived,
filter: { orderId: [orderId] },
timeout: 60_000,
});
// event.name and event.payload are typed from paymentReceived
```

A matching event is delivered once and cached by the step key. If the timeout wins,
`WaitForEventTimeoutError` is thrown.

## ctx.invoke()

Invoke a child task and wait for result:
Expand Down
Loading
Loading