I never used that feature, but, why not use the "built-in" IPC channel
given by fork?

http://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options

In addition to having all the methods in a normal ChildProcess instance,
the returned object has a communication channel built-in. See
child.send(message,
[sendHandle])for details.

Then
http://nodejs.org/api/child_process.html#child_process_child_send_message_sendhandle
with examples, child.send, child.on, at parent side, and process.send,
process.on at child side

I guess there are more info at:

http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options

   1. 'ipc' - Create an IPC channel for passing messages/file descriptors
   between parent and child. A ChildProcess may have at most *one* IPC
   stdio file descriptor. Setting this option enables the ChildProcess.send()
   method. If the child writes JSON messages to this file descriptor, then
   this will trigger ChildProcess.on('message'). If the child is a Node.js
   program, then the presence of an IPC channel will enable process.send() and
   process.on('message').


On Sun, Oct 26, 2014 at 2:53 PM, Tim Kuijsten <[email protected]> wrote:

> I would like to setup an IPC pipe with a submodule. Unfortunately it seems
> impossible to provide a stdio array with fork like the way this is done
> with spawn.
>
> Two questions:
>
> 1. is the following equivalent to `fork('lib/foo')`?
>
>     spawn('node', ['lib/foo'], {
>       stdio: ['pipe', 'pipe', 'pipe', 'ipc']
>     });
>
> 2. should I use spawn when I want to share a pipe with a submodule? i.e.
>
>     spawn('node', ['lib/foo'], {
>       stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe']
>     });
>
> -Tim
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules: https://gist.github.com/othiym23/9886289#file-
> moderation-policy-md
> Old group rules: https://github.com/joyent/node/wiki/Mailing-List-
> Posting-Guidelines
> --- You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/nodejs/544D3522.4040904%40netsend.nl.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAMs%2BDqKcJoxMQjz78Z%2BP5sn%2BvJqUmWffFykOw0wWQa%2BnjJB%3Dgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to