I'm using child_process
to fork some work on a system. I have to send some data from the child to the "father" and I'm doing it like this:
process.send({
message: "some_stuff",
some : stuff,
cb: cb
});
Where cb
is a defined callback. On the other side ("father"'s side), inspecting the message received gives undefined
for msg.cb
. Thus I guess there is something preventing me to send callbacks through IPC. Also stringifying it doesn't work. Is there a clean way to do this or should I build an infrastructure to support callbacks?
Thanks