Save topic data for the Phoenix channel

Considering Channelin which several users are connected to a certain topic, let's say "rooms:lobby"I would like to be able to store information related to the channel that I can receive and possibly update every time a new in message appears. In a sense, I want each topic to be its own theme GenServer-like.

From what I can say, it Phoenix.Socket.assign/3stores information that is local to each user, and therefore will not work.

+4
source share
1 answer

I still can’t understand what you are asking, but if I were you, I would look at using Elixir Agents try to do what you are doing. I would publish the part of the agent document that I am looking at, but, as I said, I'm not sure that I understand your question correctly.

+1
source

All Articles