I have two applications, both in Elixir
, that need to communicate with each other:
1 Server that has a
PubSub
with 2topics
, it broadcasts to onetopic
and listens to the othertopic
.1 Client, that should subscribe to the Servers
PubSub
topic
andbroadcast
to the othertopic
.
The scenario I want to get is that I start the Server, and then start one or multiple Clients that can subscribe to the server.
It just needs to work locally in the terminal, so it doesn't need any fancy.
The Server uses :phoenix_pubsub, "~> 2.1"
and the rest is mostly a Genserver
for message-handling.
The client is basically just a Genserver
that only needs to subscribe to the server and sends A message when it receives one.
Any tips how I can make them talk?