-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
child_process: add public API to unref ipc channel #9313
Comments
I've unrefed _channel, too, for similar reasons, and other reasons. I'm not sure I'd prefer for |
I like that idea. I've opened #9322 as a potential starting point. |
This commit adds a public channel property to ChildProcess. The existing _channel property is aliased to the new property, with the intention of deprecating and removing it in the future. Fixes: nodejs#9313 PR-URL: nodejs#9322 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
This commit adds a public channel property to ChildProcess. The existing _channel property is aliased to the new property, with the intention of deprecating and removing it in the future. Fixes: #9313 PR-URL: #9322 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Instead of exposing the C++ bindings object as `subprocess.channel` or `process.channel`, provide the “control” object that was previously used internally as the public-facing variant of it. This should be better than returning the raw pipe object, and matches the original intention (when the `channel` property was first added) of providing a proper way to `.ref()` or `.unref()` the channel. Refs: nodejs#9322 Refs: nodejs#9313
Instead of exposing the C++ bindings object as `subprocess.channel` or `process.channel`, provide the “control” object that was previously used internally as the public-facing variant of it. This should be better than returning the raw pipe object, and matches the original intention (when the `channel` property was first added) of providing a proper way to `.ref()` or `.unref()` the channel. Refs: nodejs#9322 Refs: nodejs#9313
Instead of exposing the C++ bindings object as `subprocess.channel` or `process.channel`, provide the “control” object that was previously used internally as the public-facing variant of it. This should be better than returning the raw pipe object, and matches the original intention (when the `channel` property was first added) of providing a proper way to `.ref()` or `.unref()` the channel. PR-URL: #30165 Refs: #9322 Refs: #9313 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
It would be nice to have a public API to
unref()
a child process's ipc channel. My use case for this is that I spawn a child process, send some messages back and forth via ipc, then at some point I want to detach the child process.child.unref()
is not enough because that only unrefs the C++ ProcessWrap handle. Currently I have to resort to also doingchild._channel.unref()
. I am not sure if this should be done automatically insidechild.unref()
or if there should be a separate function or similar.The text was updated successfully, but these errors were encountered: