How to broadcast a message from a Phoenix Controller to a Channel?

后端 未结 1 1396
遇见更好的自我
遇见更好的自我 2020-12-13 18:48

Is there a way to broadcast a message to a channel from outside that channel?

Maybe something like Channel.broadcast topic, event, data?

I saw s

相关标签:
1条回答
  • 2020-12-13 19:46

    You can use MyApp.Endpoint.broadcast(topic, event, msg) for that.

    Check http://hexdocs.pm/phoenix/Phoenix.Endpoint.html

    0 讨论(0)
提交回复
热议问题