O'Reilly logo

Functional Web Development with Elixir, OTP, and Phoenix by Lance Halvorsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required