One thing about Phoenix Channels that I’ve never really understood is the purpose of Phoenix.Socket
. From the docs and guides, I simply understand it as, “The place where you lay out the mapping of topics for your channels”. I create a MyAppWeb.UserSocket
module, and leave it at that.
I think one question that might help me understand it better is: Would there ever be a use case for having more than one socket handler in a Phoenix app? When would you opt for multiple socket handlers vs just separate channels?