Websockets Rooms

Since Wappler version 3.8.2, Sockets have received advanced features. In several training articles, Teodor outlined how to use functions such as Emit / Direct Message / Broadcast / Socket Identify

However, there is no information in the documentation on how to use Join Room / Leave Room / Get Joined Rooms / Get All Rooms

I would like to get a description of these functions at least in general terms. When and how does it make sense to use them in a Wappler?

Bump

Bump for room/namespace reference docs for sockets.

Anybody implemented this and would care to share some quick pointers before I jump into it? I’ve done the basic chat message, but now need to join various users together in a multitude of dynamic rooms (threads).

@Teodor @George @patrick

Guys, any comment on this? I’m trying to allow users to move from one room to another at will, only being in one room at a time.

The Join room action is only available on the connect socket…how can I group people together in various rooms and allow them to enter/leave at will?

2 Likes

@Teodor @George @patrick

Could use any information you might have on this.

1 Like

You can create socket actions in which you then can use the join/leave room actions. You can call these actions from the client after they have a socket connection.

Available actions:

Join Room Add current client to a room
Leave Room Remove current client from a room
Get Joined Rooms Get all rooms the current client is in
Get All Rooms Get a list of all created room in the current namespace

2 Likes

Ahh, got it. Thanks for that.

I have this working for the default namespace, but can’t figure out how to incorporate a new namespace into this.

Here’s what my message socket looks like with default namespace

But with a test namespace, the Input parameters do not show:

1 Like