Repository navigation
feat: add bounded async task pool - #1526
Open
laxmanacharya8 wants to merge 1 commit into
Open
laxmanacharya8 wants to merge 1 commit into
laxmanacharya8 wants to merge 1 commit into
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
laxmanacharya8
marked this pull request as ready for review
October 16, 2026 17:52
laxmanacharya8
force-pushed
the
feat/async-worker-pool
branch
from
October 16, 2026 17:52
d350457 to
5f05e2b
Compare
6 of 7 tasks
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.
Related to #1375. API proposal following the discussion in #1393.
Chunking commands into batches leaves worker slots idle while the slowest command in each batch finishes. This adds
pool(concurrency, tasks)to start the next task as soon as a slot is free:Tasks are functions because zx commands start eagerly. The helper accepts synchronous iterables, consumes them lazily, and returns results in input order. It lives in
goods.tsand is available through the module and CLI globals, with type declarations and documentation.The proposed failure behavior is to stop scheduling on the first observed error, wait for active tasks to settle, then reject with that error. It does not kill running commands. A non-exhausted iterator is closed on failure. This contract and the argument order are open for API review; maintainer agreement on the design is still needed.
Validation on macOS with Node 24.21.0 (the signed commit has an identical file tree to the tested commit):
npm testpasses: 278 unit tests passed, one skipped; build, size, formatting, type, and license checks passed.Twelve new tests cover scheduling without batch barriers, lazy iteration, result ordering, invalid limits, sync/async failures, draining active tasks, iterator cleanup, and real zx commands/CLI usage.
Circular-dependency and CJS/ESM smoke checks pass. The new runtime code adds about 1.2 kB uncompressed; size limits reflect the measured bundles.
npm run test:coveragepasses: 98.31% lines/statements and 91.29% branches. An earlier run hit a transient failure in the existing network-dependent fetch test; both the final full test and coverage runs passed.Standard
docs:buildfails with the same VitePress/esbuild target error on unchanged main and this branch. A temporaryesnextbuild override renders the documentation successfully; repository configuration is unchanged.Setup Set the latest Node.js LTS version.
Build Built and checked the generated bundles.
Tests Ran the test suite and added coverage for the new behavior.
Docs Added API documentation and examples.
Sign The commit follows conventional commits and has a verified GitHub signature.
CoC Changes follow the project's code style and Code of Conduct.
Review This PR represents original work and is not solely generated by AI tools. Implementation and tests were generated with Codex; contributor review and input are pending.