Renamed events in GroupManager

This commit is contained in:
2024-02-22 02:01:12 +01:00
parent 3abdced846
commit 054e052da7
3 changed files with 33 additions and 5 deletions

View File

@ -36,6 +36,14 @@ $groupManager->on('created', function (ConnectionGroup $group) {
$middleware = new WebSocketMiddleware($groupManager);
```
## Sending messages
You can use the `ConnectionGoup::writeAll(string $payload)` method to send the payload to all members of the group.
## Disconnecting clients
You can disconnect clients cleanly on shutdown by using the `GroupManager::closeAll(string $reason, int $code)` method. You can also call on `ConnectionGrroup::closeAll` manually do disconnect a whole group.
## Future
* Add a GroupManagerImplementation so custom logic can be provided.