Customize Channel Behavior

Learn about customizing channel behavior.

Channel behavior

A Phoenix Channel is backed by a GenServer that lets it receive messages and store state. We can take advantage of this property of Channels to customize the behavior of our Channel on a per-connection level. This allows us to build impossible flows (or flows that would be much more complex) with standard message broadcasting, which can’t easily send messages to a single client.

We can’t customize the behavior of Sockets as much due to their process structure. We’ll focus our attention strictly on Channel-level customization for these ...