mirror of
https://github.com/plankanban/planka.git
synced 2026-02-25 03:14:50 +03:00
Socket Room creation/subscription logic #34
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @niraj1234567890 on GitHub (Oct 17, 2020).
Guys, did anyone found where did the socket room creation logic is written inside the project. I found that mainly two socket rooms are being used in the sails backend(more precisely in the helpers). ex.
board:boardIdanduser:userId. I just wanted to understand that let's say I want to create an another room and send some data to that particular room ex.project:projectId. How should I approach that.PS: I am new to the working with the sockets but have basic understanding.
@meltyshev commented on GitHub (Oct 20, 2020):
Hi! You just need to call
sails.sockets.joinsomewhere in a controller (only works for socket connections). You can find an example here -server/api/controllers/boards/create.js. If you want to join all project rooms then you need to callsails.sockets.joinfor each project in theserver/api/controllers/projects/index.js.