I have already found out that this should be a reasonable solution, right?
:)
//foobar.js
worker.on('message', function(responseData) {
// assuming worker returns `{id: ..., data: ...}`
var socket = io.sockets.sockets[responseData.id];
socket.emit('response', responseData.data);});
io.socke
Hello!
So, I think I made a design mistake.
I have a child process worker, that receives some data and sends back the
results to dynamically attached listener.
Simplified code:
//app.js
var worker = childProcess.fork('./app_modules/workers/worker1.js');
worker.setMaxListeners(0);