let cp = require("child_process");
let child1 = cp.fork(__dirname + "/sub1.js"); // В файлах тоже под одному бесконечному циклу
let child2 = cp.fork(__dirname + "/sub2.js");
while (cp) {
console.log("Running main");
}
Running: process 2
Running main
Running: process 2
Running main
Running: process 2
Running main
Running: process 2
Running: process 1
Running main
Running: process 1
Running main
Running: process 1
Running main
Running: process 2
Running main
Running: process 2
Running main
Running: process 2
Running main
Running: process 2
Running main
Running: process 2
Running main
Running: process 2
Running main
Running: process 2
Running main
Running: process 2
Running main
Running: process 2
Running: process 1
Running main
Running: process 1
Running: process 2
document.querySelector("#clickfilter").addEventListener("click", event => {
// some code
}, false);
res.on("end", () => {
res.end();
});
req.on("end", () => { // request вместо response (У преподавателя было req, но оно так не работает)
res.end();
});