
Question: How do you create a private chat between two users?
I did not find a way to get all subscribers.
When you look at the code for Phoenix.PubSub.subscribe:
# Phoenix.PubSub.subscribe
def subscribe(pubsub, topic, opts \\ [])
when is_atom(pubsub) and is_binary(topic) and is_list(opts) do
case Registry.register(pubsub, topic, opts[:metadata]) do
{:ok, _} -> :ok
# Phoenix.PubSub.unsubscribe
def unsubscribe(pubsub, topic) when is_atom(pubsub) and is_binary(topic) do
Registry.unregister(pubsub, topic)
Dwyl/I use Phoenix.Endpoint instead of Phoenix.PubSub and the PubSub is started with:
{Phoenix.PubSub, name: MyApp.PubSub},
and the standard configuration is:
config :live_map, MyAppWeb.Endpoint,
pubsub_server: MyApp.PubSub,
We don't use the "atom" form" . Does this start a registry?
I don't see anything:
iex> Registry.count(MyAppPubSub)
# 12 ????
iex> Registry.keys(MyApp.PubSub, self())
# [] ?????
Question: How do you create a private chat between two users?
When you look at the code for Phoenix.PubSub.subscribe:
Dwyl/I use
Phoenix.Endpointinstead ofPhoenix.PubSuband the PubSub is started with:and the standard configuration is:
We don't use the "atom" form" . Does this start a registry?
I don't see anything: