Yggdrasil v5.0.0 Yggdrasil.Registry View Source
Yggdrasil Registry
for adapters, transformers and backends aliases.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Gets adapter module.
Gets adapter node by name
.
Gets backend module.
Gets full channel.
Gets publisher module.
Gets subscriber module.
Gets transformer module.
Registers an adapter.
Registers a backend.
Registers a transformer.
Starts a registry with some optional options
.
Stops a registry
with optional reason
and timeout
.
Link to this section Types
name()
View Source
name() :: atom()
name() :: atom()
Registry alias.
type()
View Source
type() :: :transformer | :backend | :subscriber | :publisher | :adapter
type() :: :transformer | :backend | :subscriber | :publisher | :adapter
Registry type.
Link to this section Functions
child_spec(arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor
.
get_adapter_module(name) View Source
Gets adapter module.
get_adapter_node(name) View Source
Gets adapter node by name
.
get_backend_module(name) View Source
Gets backend module.
get_full_channel(channel)
View Source
get_full_channel(Yggdrasil.Channel.t()) ::
{:ok, Yggdrasil.Channel.t()} | {:error, term()}
get_full_channel(Yggdrasil.Channel.t()) :: {:ok, Yggdrasil.Channel.t()} | {:error, term()}
Gets full channel.
get_publisher_module(name) View Source
Gets publisher module.
get_subscriber_module(name) View Source
Gets subscriber module.
get_transformer_module(name) View Source
Gets transformer module.
register_adapter(name, module) View Source
Registers an adapter.
Creates the following entries in the $yggdrasil_registry :ets
table:
- {:adapter, name()} => module()
- {:adapter, module()} => module()
- {:subscriber, name()} => module()
- {:subscriber, module()} => module()
- {:publisher, name()} => module()
- {:publisher, module()} => module()
And also creates the following :pg2
groups:
- {:"$yggdrasil_registry", name()} => pid()
- {:"$yggdrasil_registry", module()} => pid()
- {:"$yggdrasil_registry", subscriber_module()} => pid()
- {:"$yggdrasil_registry", publisher_module()} => pid()
register_backend(name, module) View Source
Registers a backend.
Creates the following entries in the $yggdrasil_registry :ets
table:
- {:backend, name()} => module()
- {:backend, module()} => module()
register_transformer(name, module) View Source
Registers a transformer.
Creates the following entries in the $yggdrasil_registry :ets
table:
- {:transformer, name()} => module()
- {:transformer, module()} => module()
start_link(options \\ [])
View Source
start_link(Agent.options()) :: Agent.on_start()
start_link(Agent.options()) :: Agent.on_start()
Starts a registry with some optional options
.
stop(agent, reason \\ :normal, timeout \\ :infinity)
View Source
stop(pid() | GenServer.name(), term(), :infinity | pos_integer()) :: :ok
stop(pid() | GenServer.name(), term(), :infinity | pos_integer()) :: :ok
Stops a registry
with optional reason
and timeout
.