# `Alternera.PluginHosts.Starter`
[🔗](https://github.com/10e-ab/alternera-camel/blob/v0.9.0/alternera_plugin_hosts/lib/alternera/plugin_hosts/starter.ex#L1)

Starts one kind's configured hosts (`PluginHosts.configured/1`), each
once its `tenant` slug names a tenant (`Plugin.Host.tenant_id_for_slug/1`):
the pool (`PluginHosts.pool_child/3`) runs under the kind's
`DynamicSupervisor` of pools (`pools/1`) and carries the tenant's id.

Each lookup runs in a process of its own, monitored, so a slow database
holds up neither this process nor the other entries. An entry whose
slug is not looked up is asked again after 1 second, the wait doubling
to at most 30. A plugin package starts before the proxy's database, so
at boot the answer is usually `:not_started`, logged at debug: no error.
No such tenant is logged as a warning and a disabled tenant at info,
each once until the answer changes, and asked again on the same
schedule, so a tenant created, given the slug or enabled later brings
its host up. Any other failure (the read failed, the lookup crashed) is
logged as a warning on every attempt.

The slug is looked up once: a host keeps the tenant it started with
until it restarts. Should this process crash, it starts again and looks
up every entry; a pool that is already running stays as it is.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `pools`

```elixir
@spec pools(module()) :: atom()
```

The `DynamicSupervisor` `kind`'s pools run under.

# `pools_child_spec`

The child spec of `kind`'s `DynamicSupervisor` of pools.

# `start_link`

# `waiting`

```elixir
@spec waiting(module()) :: [{String.t(), String.t()}]
```

`kind`'s configured hosts whose tenant is not looked up yet, each as
`{tenant slug, name}`.

---

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