Added documentation for connection groups
This commit is contained in:
parent
c855fc177f
commit
065d96f90a
@ -13,4 +13,6 @@ foreach ($websocket->getGroup() as $other) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
To remove a group from a connection, call `setGroup(null)`.
|
To remove a group from a connection, pass `null` to `WebSocketConnection::setGroup()`.
|
||||||
|
|
||||||
|
The group will emit a `join` event (`WebSocketConnection::EVENT_JOIN`) when another member joins the group, and a `leave` event (`WebSocketConnection::EVENT_LEAVE`) when a member leaves. The events will be sent to the leaving member as well, so consider this in your logic.
|
||||||
|
Loading…
Reference in New Issue
Block a user