Adding Layers to Phoenix Channels
Let’s learn to figure out how we could integrate our OTP layers into Phoenix Channels to build interactive applications.
Phoenix channels
Phoenix Channels are a great way to build interactive applications using JavaScript. We won’t try to cover this framework exhaustively, and will instead focus on the parts related to the integration of OTP applications. Briefly, it works like this:
-
The developer configures Phoenix using some transport. For convenience, let’s say the user is using WebSockets.
-
On the client, the developer establishes communication with Phoenix by opening a WebSocket connection on a particular channel, meaning all communication covering a topic of interest for that user.
-
On the server, the developer implements the code for that channel using a callback library.
Get hands-on with 1400+ tech skills courses.