O'Reilly logo

Programming Phoenix by Jose Valim, Bruce Tate, Chris McCord

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

Wrapping Up

In this chapter, you learned to build simple client/server APIs with Phoenix channels. Though the problem had many layers, it was easy to understand the flow because clients connected to servers, and both sides maintained the connection until the conversation was over. Along the way:

  • You learned to connect to a server-side channel through an ES6 client.

  • We built a server-side channel with both long-polling and WebSocket support.

  • We built a simple API to let users join a channel.

  • We processed inbound messages from OTP with handle_info and channels with handle_in.

  • We sent broadcast messages with broadcast!.

  • We authenticated users with Phoenix.Token.

  • We persisted annotations with Ecto.

Though channels are by far the most exciting feature ...

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