View Source Antikythera.Registry.Unique (antikythera v0.5.1)
A global (cluster-wide) process registry to implement 1-to-1 process communications.
Process names can be arbitrary string as long as it's unique within an executor pool. Each process is not allowed to have more than one name. When the registered process dies its name will be automatically removed from the registry.
Note that the uniqueness of names is not strictly checked; in case of race conditions of simultaneous registrations on different nodes, multiple processes successfully register the same name. The conflict will be resolved by choosing a single process and killing the others. To avoid troubles with this kind of naming conflicts, it's recommended to use intrinsically unique IDs such as login IDs of clients.
Summary
Functions
@spec register(String.t(), Antikythera.ExecutorPool.Id.t() | Antikythera.Context.t()) :: :ok | {:error, :taken | :pid_already_registered}
@spec send_message( String.t(), Antikythera.ExecutorPool.Id.t() | Antikythera.Context.t(), any() ) :: boolean()