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

Connect the Channel to the Game

Here’s where we begin to do the real work of getting our new game channel talking to the game server. We’re going to build out new clauses of handle_in/3 that correspond to the public interface functions we wrote for IslandsEngine.Game. We’ll pick the right communication strategy for each action, and we’ll continue to check our work at each step, both in the browser consoles and in IEx.

The mechanics of making these connections is so easy, it’s going to feel like cheating. When we’re done, all the actions a player can take in the game will be exposed on the web through a channel interface.

For all of these new actions, we’re going to follow the same pattern we used for the "hello" function. We’ll define a new ...

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