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.js
is required, replace yourpriv/static/js/phoenix.js
with 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/3
callbacks. In0.8.0
,event/3
has 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/3
now accept the socket as the last argument. This mimicks GenServer APIs - The return signature of
handle_in
, `handle_