Closed shikanime closed 5 years ago
Can you elaborate?
Actually every Horde components are discovered statically via Erlang node name:
{HelloWorld.HelloDynamicSupervisor, :"count1@127.0.0.1"}
In the case of a dynamic cluster such as under a container orchestrator like Kubernetes, we have to monitor the node to join or leave and ensure proper synchronization of the Horde cluster on the user space can be sometime less convenient.
Instead the component should join the pg2 {:horde, name}
group at startup where name can be HelloWorld.HelloDynamicSupervisor
.
In comparaison Phoenix.PubSub
is using {:phx, name}
to discover every of his node on the Erlang cluster.
What do you think? Can there be any issues?
I think I would rather leave this up to the person who is using Horde. If you would like to submit a PR documenting how to get Horde working with pg2, then I would accept that.
It would be more convenient to create a cluster of
DynamicSupervisor
/Registry
using PG2 by default such asPhoenix.Pubsub
.