As I a beginner with Phoenix Pubsub, and I got the strange situation need to help to explain.
I have small application use Phoenix Pubsub, then there are two case:
Run application with “mix run --no-halt”, and check logs from code IO.puts(“Check pg2 groups: #{inspect(:pg2.which_groups())}”), then got [phx: MyDemo.PubSub.Adapter]
Run application with “iex --sname demo_node -S mix phx.server --no-halt”, and check logs from code IO.puts(“Check pg2 groups: #{inspect(:pg2.which_groups())}”) , then got [phx: Phoenix.PubSub.PG2, phx: MyDemo.PubSub.Adapter]
I wonder why there is the pg2 group “phx: Phoenix.PubSub.PG2” in case #2. Could anyone please explain?
It is not much problematic, as I can get the correct pg2 group and get the members to send directly messages to. But there is still a bit confuse and need to clarify. Then could you please help @chrismccord ?
My guess is that this is only added when serve endpoints is true, although I haven’t read through the code deep enough to answer that with 100% certainty.