# `Decree.Registration.Adapter`
[🔗](https://github.com/sparkle-space/decree/blob/v0.1.0/lib/decree/registration/adapter.ex#L1)

Defines a behaviour for a process registry to be used by Decree.

By default, Decree will use a local process registry, defined in
`Decree.Registration.LocalRegistry`, that uses Elixir's `Registry` module
for local process registration. This limits Decree to only run on a single
node. However the `Decree.Registration` behaviour can be implemented by a
library to provide distributed process registration to support running on a
cluster of nodes.

# `adapter_meta`

```elixir
@type adapter_meta() :: map()
```

# `application`

```elixir
@type application() :: Decree.Application.t()
```

# `config`

```elixir
@type config() :: Keyword.t()
```

# `start_child_arg`

```elixir
@type start_child_arg() :: {module(), Keyword.t()} | module()
```

# `child_spec`

```elixir
@callback child_spec(application(), config()) ::
  {:ok, [:supervisor.child_spec() | {module(), term()} | module()],
   adapter_meta()}
```

Return an optional supervisor spec for the registry

# `start_child`

```elixir
@callback start_child(
  adapter_meta(),
  name :: term(),
  supervisor :: module(),
  child_spec :: start_child_arg()
) :: {:ok, pid()} | {:error, term()}
```

Starts a uniquely named child process of a supervisor using the given module
and args.

Registers the pid with the given name.

# `start_link`

```elixir
@callback start_link(
  adapter_meta(),
  name :: term(),
  module :: module(),
  args :: any(),
  start_options :: GenServer.options()
) :: {:ok, pid()} | {:error, term()}
```

Starts a uniquely named `GenServer` process for the given module and args.

Registers the pid with the given name.

# `supervisor_child_spec`

```elixir
@callback supervisor_child_spec(adapter_meta(), module :: atom(), arg :: any()) ::
  :supervisor.child_spec()
```

Use to start a supervisor.

# `via_tuple`

```elixir
@callback via_tuple(adapter_meta(), name :: term()) :: {:via, module(), name :: term()}
```

Return a `:via` tuple to route a message to a process by its registered name

# `whereis_name`

```elixir
@callback whereis_name(adapter_meta(), name :: term()) :: pid() | :undefined
```

Get the pid of a registered name.

Returns `:undefined` if the name is unregistered.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
