A question about Presence

Reading through the documentation, I get that you can use track/3 or track/4 to track some topic. After tracking, diff events are sent to processes tracking a presence topic.

What I want to achieve is to track other processes, and get diff events in one process only. Like I call track in one process, and it should receive events of some other processes. I don’t want those other processes to track each other, since they should get presence data from their leader.

If I call track in other processes, they also get diff events. Although I can ignore the events, I’m rather curious how would someone do this?

I can handle this using monitor, but I’m asking how to do this in Presence specifically, or even is Presence made for these kinds of situations?

Hi!

I think you might be better off using Phoenix.Tracker directly with broadcasts to some prespecified topic which leader process subscribes to in phoenix/presence.ex at v1.5.8 · phoenixframework/phoenix · GitHub

I managed to do it with :erlang.monitor, but Phoenix.Tracker seems like a good solution too. I gotta read about it more.