#How does LiveView compare to Channel and Presence?
5 messages · Page 1 of 1 (latest)
you need to take a few steps backwards and learn the basics of GenServer, Supervisor. and then Phoenix.Pubsub. and all this will fit together much easier.
Yes, liveview is based on channels, but you might still want to use channels on their own because they are a lower level tool. Liveview is for web applications, channels are more general and can be used for other things too. Presence is unrelated, and can be optionally used with either.
Use channels for client<->server communication over websocket.
Use liveview for reactive HTML UIs with state managed server side.
Use presence if you need either of those things to keep track of who is currently connected, and get notifications for when users join or leave.
Presence is built on top of PubSub, which you can also use separately with either channels or LV for general purpose PubSub events.
Quick question, can channels and presence be used for regular sockets as well?