Repository navigation
Conversation
📊 Node.js Code Coverage Report
|
huntharo
force-pushed
the
feat/2x-event-task-queue
branch
2 times, most recently
from
October 4, 2026 17:37
50400f6 to
77cec70
Compare
huntharo
force-pushed
the
feat/2x-event-task-queue
branch
4 times, most recently
from
October 5, 2026 19:08
168ef53 to
923fc23
Compare
huntharo
force-pushed
the
feat/2x-event-task-queue
branch
from
October 22, 2026 18:53
923fc23 to
1b5998f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for maintaining p-map-iterable. I use it in PwrGit and PwrSnap to bound background I/O, and in PwrAgnt to stream concurrent peer results. Reviewing those applications showed repeated completion/cancellation ticket code around the legacy queue and an admission gap for non-awaiting event callbacks.
Merge prerequisites: maintenance PR #19 and the release workflow/tooling changes have landed; the updated 1.1.x release /
releases/1.1handoff remains a prerequisite before any 2.x merge. This draft targetsmainfor design review and must not be merged before that handoff. The branch includes currentmainatde8a2b3, preserving aliases from #16, the pinned pnpm 12.7.0 toolchain and shared CI setup from #26, and the validation/security changes from #28/#27. The pnpm migration conflicts are resolved:package-lock.jsonstays removed, development/example commands use pnpm, and the Mermaid dev dependencies are added to the single-document v9 pnpm lock without changing main's existing locked versions or install policy. Its diff now contains only 10 intended API/docs files; main's generated-docs exclusion is retained. TaskQueue's implementation and theAwaited<T>result correction are preserved. Package/module integration is handled by #20. Proposed iterator/cancellation corrections in #22 remain separate and are not merged into this branch; the parent will validate the combined stack locally.BlockingQueue.enqueue()inserts its item before awaiting a reader. Three unawaited submissions withmaxUnread: 1therefore retain three items. Concurrency remains controlled, but a burst of UI/IPC events can create an unbounded input backlog.IterableQueueMapperSimple.onIdle()also permanently callsdone(), and task failures are collected in an unbounded array rather than delivered to the submitting handler.This adds
TaskQueuewith lazy operation admission, finite independent limits (concurrency: 4,maxPending: 8by default), per-task outcomes and explicit overload. Fulfilled outcomes useAwaited<T>, andadd<T>returnsPromise<Awaited<T>>, matching native promise assimilation even for explicitly promise-valued and nested promise-like task types. Existing iterable exports remain available, and the existing Simple options type is exported from the package root.submit()returns a cancellable handle with an always-resolving fulfilled/rejected outcome; ignored failed submissions cannot create unhandled task rejections.add()returns the value or rejects with the original reason, including admission errors. Its promise must be observed.onCapacity()waits without retaining task payloads; concurrent producers retry if a contender takes the capacity.onIdle()remains reusable,drain()snapshots accepted unfinished work, andclose()immediately ends admission before draining. Repeated close calls can escalate cancellation.The scheduler is separate from the legacy iterable runner because removable pending tasks, reusable idle and per-task settlement cannot safely be layered over its current input/result buffering and terminal accounting.
add()is implemented onsubmit(); there is one new scheduler. Queue-owned task count is bounded, while caller-owned payloads/results, capacity waiter count and separate queues remain application resource policy. Running operations that ignore abort can succeed or delay shutdown indefinitely. Drain/close confirm settlement rather than aggregate success.DESIGN-2.md records API choices, migration, cancellation/shutdown semantics and the assessment of #16/#17. TaskQueue implements #17's intended independent serial backlog; forwarding queue depth to
maxUnreaddoes not establish that input bound. Main now includes #16'sConcurrentMapper,MappingQueue,WorkerQueueand option aliases, which remain exported and documented alongside TaskQueue. The earlier experiment assessment records the originally inspected heads; this workstream did not close or merge #15/#16/#17.REVIEW-2.md prioritizes reproduced legacy terminal hangs, undefined value/error loss, missing source-generator cleanup and operational limits. #22 proposes those mapper corrections and external cancellation at
c25aaef, based on the same0784c65maintenance ancestor. Mapper failure releases blocked/future producers without a result consumer and preserves exact reasons, including undefined; the parent reports 94 tests and 25 lifecycle regressions passing for that separate PR. Its guaranteed third mapper signal remains assignable to existing two-argument callbacks, but directly invoking a Mapper-typed function requires the third argument when that change lands. Iterator return releases consumers and signals callbacks without awaiting uncooperative work; TaskQueue close waits for actual settlement. These companion semantics are documented as proposed, not implemented by this PR's legacy source.The README includes three Mermaid diagrams, runnable examples, explicit lifecycle/error guidance and four verified public application source links pinned to commits. No application code was edited. The authorized docs follow-up excludes generated
docsfrom TypeScript inputs and adds dev-only Mermaid rendering tobuild:docs. The scoped plugin's official repository documents support for current TypeDoc; its peers accept TypeDoc 0.28.20 and Mermaid 11.17.2. The original unscoped 1.12.0 plugin targets older TypeDoc APIs. Mermaid assets are copied locally so diagrams do not depend on a CDN. Packaging #20 must retain empty runtime and peer dependency sets when combining these dev-only additions.1a1160fErrors-type warningThe remaining TypeDoc warning concerns Simple's existing error-array type. Native AggregateError, the final Node/ESM/CommonJS support policy and runtime/peer dependency removal are owned by the package/release workstream. TaskQueue introduces no runtime dependency or aggregate-error use.
Rendered TypeDoc admission/concurrency diagram
This screenshot is from generated TypeDoc HTML after browser-side SVG rendering, with external requests blocked. All three diagrams were verified in light and dark themes.
Reproducible validation commands
Full tests ran on Node 24.21.0 with the pinned pnpm 12.7.0 toolchain. All 35 TaskQueue tests also passed on Node 22.22.1 after the pnpm migration; the earlier Node 22 smoke included examples and docs/build. The strict subprocess is part of the queue suite. A headless Chrome check waited for all six complete SVGs, switched themes and measured visible diagrams while blocking nonlocal network requests; parsing alone was not accepted as rendering evidence. Public URLs were checked through GitHub's contents API and public pages. Legacy reproductions and proposed #22 fixes are recorded in REVIEW-2.md.
Parent combined validation integrates packaging
b176585, API/docs77cec70, iterator fixes023f0dc, and maintenance0784c65/a116155locally. All 130 tests pass on Node 24; all 58 TaskQueue/lifecycle tests pass on Node 22. The real-tarball consumer matrix passes 72 configurations: 18 each with TypeScript 6 on Node 22/24/26, plus 18 with TypeScript 5.9 on Node 24. Each run installs both CJS and ESM apps from the same 21-file archive, verifies matching lockfile integrity, and checks all ten shared runtime constructors and bidirectional class types, including Node-only typings without DOM. Build, lint, examples, docs, 13 release-metadata checks, and npm audit pass; runtime and peer dependencies remain empty. Docs retain one existing warning for the legacy Simple Errors type.The maintenance PRs' final checks pass. Publication of 1.1.3 and the subsequent releases/1.1 branch cut remain pending the required approving review or explicit authorization for admin merge. The 2.x PRs remain draft.