如何从 Phoenix 控制器向频道广播消息?
How to broadcast a message from a Phoenix Controller to a Channel?
有没有办法从频道外向频道广播消息?
也许是 Channel.broadcast topic, event, data
?
我看到了这样的东西 here 但是 Phoenix.Channel.broadcast/3
的最终版本(截至今天)采用了一个暗示频道和主题的套接字。
您可以使用 MyApp.Endpoint.broadcast(topic, event, msg)
。
有没有办法从频道外向频道广播消息?
也许是 Channel.broadcast topic, event, data
?
我看到了这样的东西 here 但是 Phoenix.Channel.broadcast/3
的最终版本(截至今天)采用了一个暗示频道和主题的套接字。
您可以使用 MyApp.Endpoint.broadcast(topic, event, msg)
。