4 ms·
Seconding this approach. I've used PUB/SUB for this exact purpose. When you need to send something through the websocket then publish a message via redis and h
by stevewodil 6y ago
Seconding this approach. I've used PUB/SUB for this exact purpose.
When you need to send something through the websocket then publish a message via redis and have handlers in the code that are subscribed to that channel so every server can check if they have the websocket connection and whichever one has it will send the data through
- RangerScience 6y agoThat mostly sounds great, although TBH my first instinct would be to stick all the socket stuff in a microservice. I don't normally advocate for them, but this seems like a perfect situation: very well defined layer that contains no business logic.