feat(build-cli): adopt effection for structured concurrency#26409
Draft
tylerbutler wants to merge 4 commits intomicrosoft:mainfrom
Draft
feat(build-cli): adopt effection for structured concurrency#26409tylerbutler wants to merge 4 commits intomicrosoft:mainfrom
tylerbutler wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Replace async.mapLimit with effection's spawn-based worker pool in BasePackageCommand.processPackages, preserving bounded concurrency, error accumulation, and spinner UI. Wrap StateMachineCommand's infinite loop in effection run() with SIGINT/SIGTERM handlers for graceful shutdown. - Add effection@^4.0.0 dependency, remove async and @types/async - New src/concurrency.ts: processWithConcurrency<T> operation - New src/subprocess.ts: useExecaCommand/useExeca with ensure() cleanup - BasePackageCommand: no subclass changes required - StateMachineCommand: test mode path unchanged, non-test path gains signal handling with exit code 130 on interrupt
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.
Summary
async.mapLimitwith effection's spawn-based worker pool inBasePackageCommand.processPackages, preserving bounded concurrency, error accumulation, and spinner UIStateMachineCommand's infinite state loop in effectionrun()with SIGINT/SIGTERM handlers for graceful shutdown (exit code 130 on interrupt)effection@^4.0.0dependency; removeasyncand@types/asyncsrc/concurrency.ts: reusableprocessWithConcurrency<T>operation with progress callbackssrc/subprocess.ts:useExecaCommand/useExecahelpers withensure()cleanup for automatic subprocess termination on scope exitNo changes required to any PackageCommand subclasses or StateMachineCommand test mode paths.
Test plan
tsc --noEmit)flub exec --all "echo hello"— verify concurrent execution with spinnerflub releasecommand, Ctrl+C — verify graceful shutdown