Skip to content

Conversation

Guest0x0
Copy link
Collaborator

@Guest0x0 Guest0x0 commented Aug 6, 2025

This PR refactors the API of @process. Previously, the API is non-structural. The spawned process is orphan, and may leak if not properly waited. The previous API cannot integrate with structured concurrency as well.

This PR replaces @process.spawn with @process.run, Compared to @process.spawn, @process.run will wait until the spawned process completes. And if current task is cancelled, the spawned process will be terminated via SIGTERM, making process spawning structural.

Previous behavior can still be recovered partially:

  • to run the process in background, just use spawn or spawn_bg
  • to prevent the process from being killed, pass orphan=true to @process.run

@coveralls
Copy link

Pull Request Test Coverage Report for Build 112

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.7%) to 81.517%

Totals Coverage Status
Change from base Build 111: 0.7%
Covered Lines: 516
Relevant Lines: 633

💛 - Coveralls

@Guest0x0 Guest0x0 merged commit 347ac95 into main Aug 6, 2025
15 of 16 checks passed
@Guest0x0 Guest0x0 deleted the refine-process-API branch August 6, 2025 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants