···11----
22-'moroutine': minor
33----
44-55-Atomics-based backpressure for streams and channels; new `Int32Atomic#waitAsync` / `#notify`
66-77-**New public API on `Int32Atomic`**:
88-99-```ts
1010-const slot = int32atomic();
1111-// Park until the slot holds a value other than `expected`, with optional timeout.
1212-await slot.waitAsync(0); // 'ok' | 'not-equal' | 'timed-out'
1313-await slot.waitAsync(0, 100 /*ms*/);
1414-// Wake waiters on this slot.
1515-slot.notify(); // wake all
1616-slot.notify(2); // wake at most 2
1717-```
1818-1919-Matches `Atomics.waitAsync` / `Atomics.notify` semantics; returns `'not-equal'` synchronously (no microtask hop) if the slot already holds something different from `expected`.
2020-2121-**Streams and channels use atomics for backpressure**: streaming tasks and `channel()` no longer rely on `pause`/`resume` port messages for flow control. Internally, a `SharedArrayBuffer` tracks per-endpoint `inflight` and `state`; the producer parks on `Atomics.waitAsync` when the `highWaterMark` cap is reached and resumes when the consumer drains below it. Behavior-equivalent and much tighter under backpressure (worst-case buffering drops from ~10-20× `highWaterMark` to `highWaterMark + 1-2`).
2222-2323-**`highWaterMark` option now honored** for both `run(streamTask, { highWaterMark })` and `channel(src, { highWaterMark })`. Previously read and discarded in the streaming path.
2424-2525-**Significant throughput improvements** on streaming and channel fan-out:
2626-2727-- Worker → parent stream: ~66K items/s → ~750K items/s (11×)
2828-- Round-trip stream: ~39K items/s → ~425K items/s (11×)
2929-- Channel fan-out at 8 consumers: ~412K items/s → ~546K items/s (+33%)
3030-- Per-task dispatch: ~289K → ~328K (+14%)
3131-3232-No changes to user-facing API shape beyond the `Int32Atomic` additions.
+32
CHANGELOG.md
···11# moroutine
2233+## 1.2.0
44+55+### Minor Changes
66+77+- 24741da: Atomics-based backpressure for streams and channels; new `Int32Atomic#waitAsync` / `#notify`
88+99+ **New public API on `Int32Atomic`**:
1010+1111+ ```ts
1212+ const slot = int32atomic();
1313+ // Park until the slot holds a value other than `expected`, with optional timeout.
1414+ await slot.waitAsync(0); // 'ok' | 'not-equal' | 'timed-out'
1515+ await slot.waitAsync(0, 100 /*ms*/);
1616+ // Wake waiters on this slot.
1717+ slot.notify(); // wake all
1818+ slot.notify(2); // wake at most 2
1919+ ```
2020+2121+ Matches `Atomics.waitAsync` / `Atomics.notify` semantics; returns `'not-equal'` synchronously (no microtask hop) if the slot already holds something different from `expected`.
2222+2323+ **Streams and channels use atomics for backpressure**: streaming tasks and `channel()` no longer rely on `pause`/`resume` port messages for flow control. Internally, a `SharedArrayBuffer` tracks per-endpoint `inflight` and `state`; the producer parks on `Atomics.waitAsync` when the `highWaterMark` cap is reached and resumes when the consumer drains below it. Behavior-equivalent and much tighter under backpressure (worst-case buffering drops from ~10-20× `highWaterMark` to `highWaterMark + 1-2`).
2424+2525+ **`highWaterMark` option now honored** for both `run(streamTask, { highWaterMark })` and `channel(src, { highWaterMark })`. Previously read and discarded in the streaming path.
2626+2727+ **Significant throughput improvements** on streaming and channel fan-out:
2828+ - Worker → parent stream: ~66K items/s → ~750K items/s (11×)
2929+ - Round-trip stream: ~39K items/s → ~425K items/s (11×)
3030+ - Channel fan-out at 8 consumers: ~412K items/s → ~546K items/s (+33%)
3131+ - Per-task dispatch: ~289K → ~328K (+14%)
3232+3333+ No changes to user-facing API shape beyond the `Int32Atomic` additions.
3434+335## 1.1.0
436537### Minor Changes