Kanta.Registry (kanta v0.4.2)
Kanta Registry
Summary
Functions
Fetch the config for an Kanta supervisor instance.
Find the {pid, value}
pair for a registered Kanta process.
Build a via tuple suitable for calls to a supervised Kanta process.
Returns the pid of a supervised Kanta process, or nil
if the process can't be found.
Functions
child_spec(arg)
config(kanta_name)
@spec config(atom()) :: Kanta.Config.t()
Fetch the config for an Kanta supervisor instance.
Example
Get the default instance config:
Kanta.Registry.config(Kanta)
Get config for a custom named instance:
Kanta.Registry.config(MyApp.Kanta)
lookup(kanta_name, role \\ nil)
Find the {pid, value}
pair for a registered Kanta process.
Example
Get the default instance config:
Kanta.Registry.lookup(Kanta)
Get a supervised module's pid:
Kanta.Registry.lookup(Kanta, Kanta.Notifier)
via(kanta_name, role \\ nil, value \\ nil)
Build a via tuple suitable for calls to a supervised Kanta process.
Example
For an Kanta supervisor:
Kanta.Registry.via(Kanta)
For a plugin:
Kanta.Registry.via(Kanta, {:plugin, Kanta.DeepL.Plugin})
whereis(kanta_name, role \\ nil)
Returns the pid of a supervised Kanta process, or nil
if the process can't be found.
Example
Get the Kanta supervisor's pid:
Kanta.Registry.whereis(Kanta)
Get the pid for a plugin:
Kanta.Registry.whereis(Kanta, {:plugin, MyApp.Kanta.Plugin})