⚗️ Rebuild process adapters on a native-listener core - #246
Closed
taras wants to merge 1 commit into
Closed
Conversation
Replace the fromReadable pump architecture with a single createNativeProcess core that wires the child process entirely through native Node listeners attached in the same synchronous continuation as the spawn. posix and win32 reduce to SpawnStrategy objects: how to spawn, and how to shut down. Consequences: - the orphan window from #236 closes: a guard teardown registers before the child exists and the spawn plus all listener wiring follow with no suspension points in between, so a halt can never land between a live process and an armed teardown - close-settled means raw-output-complete by construction (#244): Node emits "close" only after both stdio streams have closed, and chunk delivery into the raw signals is synchronous with stream emission - Stdio middleware becomes a consumer layer over the raw signals; a sequencer settles join()/expect() only after both consumers drain, and a failing handler resolves the result with Err instead of hanging - the graceful-shutdown drain contract is preserved: the primary teardown registers after the consumers, so they are still alive to forward output produced during termination Ports the halt-sweep regression test from #237 and the output completeness and middleware failure tests from #245; all bite when their respective guarantees are mutated out.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
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.
Motivation
Exploration of rebuilding the process adapters so the child process is wired entirely through native Node event listeners attached in the same synchronous continuation as the spawn, removing the
fromReadablepump architecture — to see what that structure does to the orphan window (#236), output completeness atjoin()(#244), and adapter duplication.Approach
createNativeProcess(command, options, strategy), plus posix/win32 reduced toSpawnStrategyobjects (how to spawn, how to shut down).Stdiomiddleware runs as consumer tasks with a sequencer settlingjoin()after the drain (process: join() settles before stdout/stderr pumps finish Stdio middleware #244).