How to get a list of all channel topics

I’ve been searching through the channels docs and the javascript client but can’t seem to find a way to retrieve all channel topics. The goal here is to create game lobbies, so for example users would be in the main lobby and have a list of joinable game lobbies. My plan was to have a channel for each of these, but I can’t seem to find a way to retrieve these channel topics, short of maybe having a genserver keep track of them, but I was hoping there would be something like Presence.

2 Likes

I think you should be looking in Phoenix.PubSub module. They are probably stored in a ets table, but I might be wrong.

I believe you’re correct, now to figure out how to access it from within a controller…

I’m looking for something similar to this as well. Curious if you ever found anything @zinclozenga?

I want to track some metrics of how many unique topics and how many total subscribers I have in my production system so I can report that to statsd and keep a history.

Perhaps using a Tracker?

https://hexdocs.pm/phoenix_pubsub/Phoenix.Tracker.html

1 Like