Yggdrasil v5.0.0 Yggdrasil.Registry View Source

Yggdrasil Registry for adapters, transformers and backends aliases.

Link to this section Summary

Types

Registry alias.

Registry type.

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

Registry alias.

Link to this type

type() View Source
type() :: :transformer | :backend | :subscriber | :publisher | :adapter

Registry type.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

get_adapter_module(name) View Source
get_adapter_module(atom()) :: {:ok, module()} | {:error, term()}

Gets adapter module.

Link to this function

get_adapter_node(name) View Source
get_adapter_node(atom()) :: {:ok, node()} | {:error, term()}

Gets adapter node by name.

Link to this function

get_backend_module(name) View Source
get_backend_module(atom()) :: {:ok, module()} | {:error, term()}

Gets backend module.

Link to this function

get_full_channel(channel) View Source
get_full_channel(Yggdrasil.Channel.t()) ::
  {:ok, Yggdrasil.Channel.t()} | {:error, term()}

Gets full channel.

Link to this function

get_publisher_module(name) View Source
get_publisher_module(atom()) :: {:ok, module()} | {:error, term()}

Gets publisher module.

Link to this function

get_subscriber_module(name) View Source
get_subscriber_module(atom()) :: {:ok, module()} | {:error, term()}

Gets subscriber module.

Link to this function

get_transformer_module(name) View Source
get_transformer_module(atom()) :: {:ok, module()} | {:error, term()}

Gets transformer module.

Link to this function

register_adapter(name, module) View Source
register_adapter(name(), module()) :: :ok

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()
Link to this function

register_backend(name, module) View Source
register_backend(name(), module()) :: :ok

Registers a backend.

Creates the following entries in the $yggdrasil_registry :ets table:

- {:backend, name()}   => module()
- {:backend, module()} => module()
Link to this function

register_transformer(name, module) View Source
register_transformer(name(), module()) :: :ok

Registers a transformer.

Creates the following entries in the $yggdrasil_registry :ets table:

- {:transformer, name()}   => module()
- {:transformer, module()} => module()
Link to this function

start_link(options \\ []) View Source
start_link(Agent.options()) :: Agent.on_start()

Starts a registry with some optional options.

Link to this function

stop(agent, reason \\ :normal, timeout \\ :infinity) View Source
stop(pid() | GenServer.name(), term(), :infinity | pos_integer()) :: :ok

Stops a registry with optional reason and timeout.