-
Notifications
You must be signed in to change notification settings - Fork 482
Add detach_process
option to spawn
#9400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add detach_process
option to spawn
#9400
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for opening this pull request.
Because this is your first time contributing to this repository, make sure you've read our Contributor Guide and Code of Conduct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great so far!
detach_process
option
detach_process
optiondetach_process
option to spawn
The CI failures seems unrelated. The C++ tests passes locally. |
Related Discussion
For more context, see this thread:
https://discord.com/channels/1062300748202921994/1354497232103145642
Related to: 1942b43
What’s New
This update introduces a
detach_process
option for thespawn()
method in theViewer
(available in Rust, Python, and C++).Why It Matters
This gives client code control over whether the
Viewer
runs independently of the parent process or remains tied to it. Keeping it attached ensures theViewer
closes when the parent process terminates withSIGINT
. Detaching (default behavior) allows it to persist if needed.While this achieves the desired functionality, a future improvement could be adding a proper
close()
method to gracefully shut down theViewer
context.Note on Web Support
This change wasn’t applied to the web API since I'm not sure how process management behaves there.
How it was tested?
(Python only) Small edit to the
minimal.py
to evaluate the behaviorAs expected, when
detach_process=False
if we send aSIGINT
to the application, the Viewer exits and the PID assigned to it is retired.