As mentioned previously, channels are the in-between for sockets and topics. They essentially act as the controllers of the Phoenix real-time application puzzle. The easiest way for us to really understand this is to dive right into the code and start messing around with things until they break!
Phoenix provides a set of macros for us to use with channels, much in the same way it does for controllers (via use VocialWeb, :controller) or with views (via use VocialWeb, :view). We'll create a new file at lib/vocial_web/channels/polls_channel.ex:
defmodule VocialWeb.PollsChannel do use VocialWeb, :channelend
Notice that here we're using the :channel macro instead of :controller or :view or anything like that! Next, we'll ...