Horde.Registry.register
register
, go back to Horde.Registry module for more information.
Specs
register( registry :: Registry.registry(), name :: Registry.key(), value :: Registry.value() ) :: {:ok, pid()} | {:error, {:already_registered, pid()}}
Register a process under the given name. See Registry.register/3
.
When 2 clustered registries register the same name at exactly the
same time, it will seem like name registration succeeds for both
registries. The function returns {:ok, pid}
for both of these
calls.
However, due to the eventually consistent nature of the CRDT,
conflict resolution will take place, and the CRDT will pick one of
the two processes as the "winner" of the name. The losing process
will be sent an exit signal (using Process.exit/2
) with the
following reason:
{:name_conflict, {name, value}, registry_name, winning_pid}
When two registries are joined using Horde.Cluster.set_members/2
,
this name conflict message can also occur.
When a cluster is recovering from a netsplit, this name conflict message can also occur.