I am trying to build a web app using Mojolicious and websocket, where my
server script will publish messages that will be broadcast to all the
connected clients, using websocket. I am able send messages to the clients
individually or in a loop, like,
foreach my $cid (keys %$clients) {
$clients->{$cid}->send_json($data);
}
My issue is, as the number of clients increases, the loop will take long time
to publish messages (which will defeat the purpose of realtime updates using
websocket). Is there a way that the message can be broadcast to all the clients
at once, instead of sending one by one.
Please let me know your inputs.
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.