D
D
DragoSFire2015-10-24 14:24:18
Node.js
DragoSFire, 2015-10-24 14:24:18

How to balance and sync chat on nodejs?

Hello!
There is a chat on nodejs + socket.io. I read a couple of articles on the net about this, there are options using cluster, nginx. Actually, everything is clear here, but it is not clear how to synchronize clients from all workers? Let's say 10 people on one worker, and the other part on another, how to send messages to all active clients?
When a client connects, I create an object with some flags and its socket, and add it to the array with all other clients.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question