# `Rho.ToolRegistry.Source`
[🔗](https://github.com/GenericJam/rho/blob/v0.1.0/lib/rho/tool_registry.ex#L143)

A source of tools the registry asks on every call, for tool sets that
change while the app runs (the Dyn layer's generations, `Rho.Dyn.Source`:
tools the agent writes, compiles and activates on the device). Configure with
`{Rho.Supervisor, tool_sources: [MySource]}` or
`config :rho, :tool_sources, [MySource]`.

`c:tools/0` and `c:lookup/1` run in the caller's process (the loop, at the
start of every model call) and must be cheap: read an ETS table or a
persistent term, don't call a process that may be busy.

# `lookup`

```elixir
@callback lookup(name :: String.t()) :: {:ok, module()} | :error
```

The source's current tool named `name`.

# `tools`

```elixir
@callback tools() :: [{String.t(), module()}]
```

The source's current tools as `{name, module}`.

# `watch`
*optional* 

```elixir
@callback watch(pid(), module()) :: :ok
```

A call of `module` (any tool, not only this source's) is about to run in
the task `pid`: a source that keeps its tools on probation can monitor
it. Runs in that task, before the tool; it must return quickly.

---

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