With socket.io-redis
module we can easily emit/broadcast
message with saved-socket-id
.
io.to(socket-id-from-redis).emit('serverEvent', "some message");
On the otherhand, what's the best way for listening to the socket with out any extra/external redis sub/pub clients.
When I initialized socket-io.redis
module, I had configured a subscriber with return_buffers: true, I think module solves it behind the scenes but I couldn't find any examples.
Is there a smooth way to do that with socket.io-redis
module ? Or each clusters socket listeners must publish messages and i must manually subscribe'em from other clusters ?
Thank you.