# `Ankusa.Routes.TableOwner`
[🔗](https://github.com/jamescarr/ankusa/blob/ankusa-v0.7.0/packages/ankusa/lib/ankusa/routes/table_owner.ex#L1)

Keeps an instance's route snapshot table alive across a routes-store
restart. It creates the table and is its heir: the store writes into it
(`Ankusa.Routes.Snapshot` asks for it with `hand_over/2`), and when the
store dies the table comes back here instead of being deleted. The
restarted store takes it over with `Ankusa.Routes.Snapshot.adopt/1` and
resumes from the routes in it, rather than starting again from its config.

Started by `Ankusa.Instance` just before the routes store; nothing else
needs to call it.

# `child_spec`

```elixir
@spec child_spec(keyword()) :: Supervisor.child_spec()
```

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `hand_over`

```elixir
@spec hand_over(atom(), pid()) :: :ok | {:error, :not_running | :owned_elsewhere}
```

Give the table to `pid` (the routes store). `{:error, :not_running}` when
this instance has no owner process (a store started on its own, in tests).

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

---

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