Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Phoenix 有一个很好的用于广播存在更改的事件,称为presence_diff. 我试图找到一种方法将此事件重命名为更特定于我的域的内容(agent_diff在我的情况下)。
presence_diff
agent_diff
有谁知道这样做是否有惯用的方法?
这是我想出的解决方案,如果您有更好的方法,请告诉我
intercept ["presence_diff"] def handle_out("presence_diff", msg, socket) do push(socket, "agent_diff", msg) {:noreply, socket} end