Let’s Build It

The big picture for this final chapter is that we’re opening up the public interface we created for the game server to the web. The game server is a stateful system. Modern web front ends are also stateful. We’re going to build a Phoenix channel as a stateful, persistent connection between these two stateful systems. This new channel’s public interface will become the mechanism clients will use to interact with the game.

Here’s the Plan

We’re going to build that channel function by function, and we’ll check its behavior at each step along the way by calling JavaScript code in the browser’s developer tools console. We want the new channel to communicate directly with an individual GenServer process for a game. Since channels multiplex ...

Get Functional Web Development with Elixir, OTP, and Phoenix now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.