Local key-value process storage for Bier instances
Summary
Functions
Retrieves the configuration for a Bier instance
Retrieves the configuration for a Bier instance, or :error when no such
instance is registered
Returns the names of the Bier instances currently registered (live supervisors)
Returns a via tuple useful for processes name registration
Returns the process identifier (pid) of a supervised Bier process
Types
Functions
@spec config(Bier.name()) :: Bier.Config.t()
Retrieves the configuration for a Bier instance
Examples
Get the default Bier instance configuration:
Bier.Registry.config(Bier)
@spec fetch_config(Bier.name()) :: {:ok, Bier.Config.t()} | :error
Retrieves the configuration for a Bier instance, or :error when no such
instance is registered
Same lookup as config/1, for callers that must tolerate an unregistered name
(e.g. an error raised before the request reached a live instance) instead of
raising.
Examples
Bier.Registry.fetch_config(Bier)
#=> {:ok, %Bier.Config{}}
@spec instance_names() :: [Bier.name()]
Returns the names of the Bier instances currently registered (live supervisors)
Instance supervisors register under the bare (atom) name; instance-scoped
processes under {name, role} tuples — only the bare names are returned.
Examples
Bier.Registry.instance_names()
#=> [Bier]
Returns a via tuple useful for processes name registration
Examples
To retrieve a suitable via tuple for a Bier supervisor:
Bier.Registry.via(Bier)In case you want to use the via tuple to store process metadata you can proceed as follows:
Bier.Registry.via(Bier, nil, config)
Returns the process identifier (pid) of a supervised Bier process
If the given process can't be found, the returned value is nil.
Examples
Retrieves the Bier supervisor's pid:
Bier.Registry.whereis(Bier)Get a supervised module's pid:
Bier.Registry.whereis(Bier, Postgrex)