The issue is:
Lets assume we have two Node.js processes running:
example1.js
andexample2.js
.In
example1.js
there is functionfunc1(input)
which returnsresult1
as a result.Is there a way from within
example2.js
to callfunc1(input)
and obtainresult1
as the outcome?
From what I've learned about Node.js, I have only found one solution which uses sockets for communication. This is less than ideal however because it would require one process listening on a port. If possible I wish to avoid that.
EDIT: After some questions I'd love to add that in hierarchy example1.js
cannot be child process of example2.js
, but rather the opposite. Also if it helps -- there can be only one example1.js
processing its own data and many example2.js
's processing own data + data from first process.