Skip to Content
Phoenix Web Development
book

Phoenix Web Development

by Brandon Richey
April 2018
Beginner to intermediate content levelBeginner to intermediate
406 pages
9h 33m
English
Packt Publishing
Content preview from Phoenix Web Development

Creating our Presence ETS table and GenServer

Let's start off with an ETS table that can store information about the various changes in Presence over the course of its lifetime. We'll need to wrap this inside of a GenServer, since we need a process that will live with our server rather than with each request (remember that ETS tables only live as long as their owner). Don't worry too much about the GenServer conventions at play here; we're going to dive into all of this in much, much more detail over the next chapter!

The important logic here will be all of the ETS-specific code! Let's start by creating a new file under lib/vocial called chat_cache.ex.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Phoenix in Action

Phoenix in Action

Geoffrey Lessel
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781787284197Supplemental Content