HareMq.GlobalNodeManager
(hare_mq v1.4.0)
Copy Markdown
Summary
Functions
Waits until the :global name registry is synchronized across all connected
nodes before returning, with a 30-second timeout.
Functions
Waits until the :global name registry is synchronized across all connected
nodes before returning, with a 30-second timeout.
Two cases:
Single-node (
Node.list()is empty) — no remote nodes to synchronize with, so we return immediately.:globalregistration on a single node is always instantaneous.Multi-node — we call
:global.sync/0which blocks until the registry has been reconciled across all connected nodes. This ensures that a subsequentGenServer.start_link(..., name: {:global, name})call will not race with an identical registration on another node.
Called from HareMq.Worker.Consumer.start_link/1 before registering the
consumer globally.