broadcast method
Broadcasts a message to all connected clients
Implementation
Future<void> broadcast({
required String body,
String? contentType,
Map<String, String>? headers,
}) async {
for (final connection in connections) {
// Send to a special broadcast destination for each client
await sendToDestination(
destination: '/broadcast/${connection.sessionId}',
body: body,
contentType: contentType,
headers: headers,
);
}
}