You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Love the library as it's quite simple to use. Got question about the communication between worker & master
At the moment the communication is from worker reporting to the master via worker's process.send
and the server is listening on 'message' event. But when a process has gone south and new worker spins up. the server will not get the new message as there's no listening in the fork event on the cluster.
I'm hitting this problem right now. and I think there are two ways to solve it.
make the server.cluster.proxy to listen on 'fork' event and make it pick up new workers.
use cluster.worker.send in the client and process.on('message') on the server proxy.
feels to me the second way is more natural. Thought?
I can quickly submit a PR if you want. Let me know if you want to think more about it.
Cheers
The text was updated successfully, but these errors were encountered:
As you said, I'll go for option 1. I'm totally open to contributions, so I encourage you to send a PR. It'd be very nice.
To be honest, currently I don't use this library. I believe a server should not collect, aggregate and expose it own metrics. Said that, under some circumstances express-metrics is still useful.
I'll take a look to the process messaging when a worker disconnects and a new one is forked.
Well as long as the stats port is different and not open to public. I'm ok as I'm at the moment try to come up with some stats quick to verify my idea. It's quite useful. Also the stated part is cool too.
Hi there,
Love the library as it's quite simple to use. Got question about the communication between worker & master
At the moment the communication is from worker reporting to the master via worker's process.send
and the server is listening on 'message' event. But when a process has gone south and new worker spins up. the server will not get the new message as there's no listening in the fork event on the cluster.
I'm hitting this problem right now. and I think there are two ways to solve it.
make the server.cluster.proxy to listen on 'fork' event and make it pick up new workers.
use cluster.worker.send in the client and process.on('message') on the server proxy.
feels to me the second way is more natural. Thought?
I can quickly submit a PR if you want. Let me know if you want to think more about it.
Cheers
The text was updated successfully, but these errors were encountered: