The channel layer received significant features and an overhaul of the topic abstraction. Upgrade your 0.7.x channels should only require a few simple steps.
Notable changes:
- An updated version of
phoenix.jsis required, replace yourpriv/static/js/phoenix.jswith https://github.com/phoenixframework/phoenix/blob/v0.8.0/priv/static/js/phoenix.js - "topic" is now just an identifier. You join topics, broadcast on topics, etc. Channels are are dispatched to based on topic patterns in the router.
- Channel callbacks in 0.8.0 introduce the concept of outgoing events. Prior to 0.8.0, chanenls only processed incoming events via the
event/3callbacks. In0.8.0,event/3has been renamed tohandle_in/3, and outgoing events callbacks can be defined viahandle_out/3 - All channel callbacks, such as
join/3,leave/2,handle_in/3, andhandle_out/3now accept the socket as the last argument. This mimicks GenServer APIs - The return signature of
handle_in, `handle_