Simple question, is it possible to make a broadcast from controller to all active channel?
For example here is my controller:
# Controller
defmodule Rumbl.DiscussionController do
use Rumbl.Web, :controller
def blast(conn, _params) do
Rumbl.Endpoint.broadcast("room:*", "push_notifications", %{message: "broadcast coooyt!!"})
render conn, "blast.json"
end
end
And i have two client that still active in two channel, e.g: room:1
and room:2
. Then when i call blast
action, then that two client will receive some alert or push notifications. Or even better if it possible to broadcast to all channel maybe like broadcast("*:*", "push_notifications", %{})
, so then all user if inside different channel e.g room
and discussions
will be receive push notifications.
Thanks in advance