Skip to content

Loading…

Maybe we need to call process.parent.emit('evt', 'some data'); #3191

Closed
wants to merge 1 commit into from

2 participants

@iwillwen

I think if we use message event to do many things, we will need to route it. But if we use process.parent like window.parent in browser to do something, we can just call process.parent.emit('evt', 'something');

@isaacs

That won't actually do anything, though. If you have a reference to the child process object, then you are in the parent process, and can just call process as a global. The child process object is not actually the same object as the process object in the child. They exist in entirely different memory spaces.

@isaacs isaacs closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 30, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/child_process.js
View
2 lib/child_process.js
@@ -391,6 +391,8 @@ function maybeClose(subprocess) {
function ChildProcess() {
var self = this;
+ this.parent = process;
+
this._closesNeeded = 1;
this._closesGot = 0;
Something went wrong with that request. Please try again.