mule/node
Stable node identity for a Mule instance — the node column written into
mule_peers and the value compared in the leader-election upsert’s
returning (node = $self).
In a distributed BEAM the identity is the node name (e.g.
mule@10.0.0.1), so two real nodes sharing a database naturally differ.
Out of distribution erlang:node/0 is nonode@nohost for every process,
so a bare node name could not tell two single-VM instances apart; we append
the caller-supplied instance seed (the Mule instance name). The seed must be
fixed once per instance at mule.start and threaded through — deriving it
fresh inside the peer actor would change the identity on a restart, leaving
the restarted peer unable to match (and renew) the mule_peers row it
already owns until the lease expired.
Values
pub fn identity(instance_seed instance_seed: String) -> String
The node identity for the instance named instance_seed. Uses the BEAM node
name when distributed; out of distribution, a stable nonode-<seed> so
distinct single-VM instances (and the two-pool multi-node tests) get
distinct identities.