···11----
22-'moroutine': minor
33----
44-55-Graceful async worker pool shutdown
66-77-- `await using run = workers(4)` waits for in-flight tasks to settle before terminating workers
88-- `run.signal` is an `AbortSignal` that fires when the pool starts disposing — thread it into tasks for cooperative cancellation
99-- `workers(size, { shutdownTimeout: ms })` force-terminates workers if graceful shutdown exceeds the timeout
1010-- Existing `using run` (sync dispose) still terminates immediately
-20
.changeset/error-stack-traces.md
···11----
22-'moroutine': minor
33----
44-55-Include main-thread call site in error stack traces
66-77-Errors thrown during task dispatch now have stack traces that show where `run()`, `exec()`, or `await task` was called. The original worker-side error is preserved as `err.cause` with its own stack pointing to the moroutine source.
88-99-```
1010-Error: boom
1111- at trackValue (worker-pool.ts:52:15)
1212- at async loadUser (user-code.ts:7:3)
1313- at async main (user-code.ts:11:3) {
1414- [cause]: Error: boom
1515- at fixtures/math.ts:6:9 // original throw site on the worker
1616- at MessagePort.<anonymous> (worker-entry.ts:173:25)
1717-}
1818-```
1919-2020-Built-in error subclass identity (`TypeError`, `RangeError`, etc.) is preserved on the outer wrapper.
-7
.changeset/error-transfer.md
···11----
22-'moroutine': minor
33----
44-55-Preserve error details across worker boundary
66-77-Errors thrown in moroutines now transfer with `message`, `stack`, `cause`, and built-in subclass identity (`TypeError`, `RangeError`, etc.) preserved via structured clone. Previously only the message string was kept.
-9
.changeset/load-balancing.md
···11----
22-'moroutine': minor
33----
44-55-Configurable load balancing for worker pools
66-77-- `workers(size, { balance: leastBusy() })` routes tasks to the worker with the fewest in-flight tasks
88-- `roundRobin()` cycles through workers in order (default, same as before)
99-- Custom balancers implement `Balancer.select(workers, task)` for full control over scheduling
-10
.changeset/per-worker-dispatch.md
···11----
22-'moroutine': minor
33----
44-55-Per-worker dispatch with `assign()` and `run.workers`
66-77-- `run.workers` exposes a read-only array of `WorkerHandle`s, one per pool worker
88-- `assign(worker, task)` returns a copy of the task pinned to a specific worker
99-- `worker.exec(task)` dispatches directly to a specific worker
1010-- Channel fan-out no longer requires knowing the worker count
-7
.changeset/pool-worker-ref.md
···11----
22-'moroutine': patch
33----
44-55-Fix pool workers exiting early with top-level await
66-77-Pool workers are now ref'd for the lifetime of the pool, preventing the Node.js event loop from exiting prematurely when using `using run = workers()` with top-level `await`. Dedicated workers continue to ref only while tasks are in-flight.
-10
.changeset/task-type-refactor.md
···11----
22-'moroutine': major
33----
44-55-Unify Task and StreamTask under a single `Task<T>` type
66-77-- `Task<T>` is `PromiseLike<T>` for value tasks, `AsyncIterable<T>` for streaming tasks, or just the base dispatch shape when unparameterized
88-- `Balancer.select()` receives `Task` instead of `Task<any> | StreamTask<any>`
99-- `Arg<T>` simplifies to `T | Task<T>`
1010-- Classes renamed to `PromiseLikeTask<T>` and `AsyncIterableTask<T>` (internal, prefer `Task<T>` in type annotations)
+56
CHANGELOG.md
···11# moroutine
2233+## 1.0.0
44+55+### Major Changes
66+77+- e46aca0: Unify Task and StreamTask under a single `Task<T>` type
88+ - `Task<T>` is `PromiseLike<T>` for value tasks, `AsyncIterable<T>` for streaming tasks, or just the base dispatch shape when unparameterized
99+ - `Balancer.select()` receives `Task` instead of `Task<any> | StreamTask<any>`
1010+ - `Arg<T>` simplifies to `T | Task<T>`
1111+ - Classes renamed to `PromiseLikeTask<T>` and `AsyncIterableTask<T>` (internal, prefer `Task<T>` in type annotations)
1212+1313+### Minor Changes
1414+1515+- 9ab6016: Graceful async worker pool shutdown
1616+ - `await using run = workers(4)` waits for in-flight tasks to settle before terminating workers
1717+ - `run.signal` is an `AbortSignal` that fires when the pool starts disposing — thread it into tasks for cooperative cancellation
1818+ - `workers(size, { shutdownTimeout: ms })` force-terminates workers if graceful shutdown exceeds the timeout
1919+ - Existing `using run` (sync dispose) still terminates immediately
2020+2121+- 3612d52: Include main-thread call site in error stack traces
2222+2323+ Errors thrown during task dispatch now have stack traces that show where `run()`, `exec()`, or `await task` was called. The original worker-side error is preserved as `err.cause` with its own stack pointing to the moroutine source.
2424+2525+ ```
2626+ Error: boom
2727+ at trackValue (worker-pool.ts:52:15)
2828+ at async loadUser (user-code.ts:7:3)
2929+ at async main (user-code.ts:11:3) {
3030+ [cause]: Error: boom
3131+ at fixtures/math.ts:6:9 // original throw site on the worker
3232+ at MessagePort.<anonymous> (worker-entry.ts:173:25)
3333+ }
3434+ ```
3535+3636+ Built-in error subclass identity (`TypeError`, `RangeError`, etc.) is preserved on the outer wrapper.
3737+3838+- 5137201: Preserve error details across worker boundary
3939+4040+ Errors thrown in moroutines now transfer with `message`, `stack`, `cause`, and built-in subclass identity (`TypeError`, `RangeError`, etc.) preserved via structured clone. Previously only the message string was kept.
4141+4242+- d13cd40: Configurable load balancing for worker pools
4343+ - `workers(size, { balance: leastBusy() })` routes tasks to the worker with the fewest in-flight tasks
4444+ - `roundRobin()` cycles through workers in order (default, same as before)
4545+ - Custom balancers implement `Balancer.select(workers, task)` for full control over scheduling
4646+4747+- cdccfdb: Per-worker dispatch with `assign()` and `run.workers`
4848+ - `run.workers` exposes a read-only array of `WorkerHandle`s, one per pool worker
4949+ - `assign(worker, task)` returns a copy of the task pinned to a specific worker
5050+ - `worker.exec(task)` dispatches directly to a specific worker
5151+ - Channel fan-out no longer requires knowing the worker count
5252+5353+### Patch Changes
5454+5555+- e2dabc1: Fix pool workers exiting early with top-level await
5656+5757+ Pool workers are now ref'd for the lifetime of the pool, preventing the Node.js event loop from exiting prematurely when using `using run = workers()` with top-level `await`. Dedicated workers continue to ref only while tasks are in-flight.
5858+359## 0.1.1
460561### Patch Changes