So i'm trying to make two node.js processes communicate. Here is a quick exemple of what i'm trying to do :
Process1.js
var process2 = require('./process2');
class Process1 {
constructor() {
this._value = process2.getValue();
this.value = [];
}
addValue(_value) {
this.value.push(_value);
}
}
Process2.js
var process1 = require('./process1');
class Process2 {
constructor() {
this.value = "Hello";
}
getValue() {
process1.addValue(this.value);
}
}
I know this code can be done easily and does not require to be in two separate files ... But it's just an example.
I've tried using FORK but since it's an "circular" process loop …
If anyone has any idea on what I can do to have those two process working with each other, that would be kindly appreciated :)