March 2020
Intermediate to advanced
328 pages
7h 58m
English
Phoenix Presence is an implementation of Tracker that provides helper functions for working with Channels. Its implementation of handle_diff/2 broadcasts changes locally using PubSub when a process joins or leaves the Tracker. Clients listen for change messages and process them to keep a client-side version of the Tracker state. The official Phoenix JavaScript library includes a Presence class that handles the messages automatically for us. The following figure shows the flow of Presence updates:

Due to the similarity between the two libraries, it can be confusing to decide which one to use. If you want to have ...
Read now
Unlock full access