Answer the question
In order to leave comments, you need to log in
How to pass data from Redis event to socket.join() method?
Hello. I am writing a chat for a project using laravel redis and socket.io. The logic should be such that when I have ioredis on the node server, it catches the redis event and from there it should pull out an object with the room id and pass it to the socket.join (room) method to create a room. But the point is that I can’t put the pmessage event handler in the socke.io connection handler, because if I do that, the pmessage event will be hung every time someone connects, but I can’t remove the connection handler either, since I need the one passed in this socket handler to run the socket.join method. I looked through thousands of articles and couldn't find an answer. Do not tell me how to make it so that I would not create a new handler every time and the id transfer would work correctly. Thanks in advance
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question