# `Lotus.Cache.Relay`
[🔗](https://github.com/elixir-lotus/lotus/blob/v1.2.0/lib/lotus/cache/relay.ex#L1)

Applies cache invalidations sent by other nodes to this node's adapter.

`Lotus.Cache.delete/1` and `Lotus.Cache.invalidate_tags/1` apply their
change locally and, when `Lotus.Cache.scope/1` answers `:node` for that
operation, send it on the `:cache` topic of `Lotus.Notifier`. This
process listens on that topic on every node and calls the same adapter
function locally, without notifying again. Values never travel: a node
whose entry was dropped fills it on its next miss.

Each notification is applied in its own task under Lotus's task
supervisor, so a slow adapter call, such as a routed delete that waits on
a node that stopped answering, does not hold up the notifications behind
it. Relayed operations are idempotent deletes, so their order does not
matter.

`Lotus.Supervisor` starts one relay per node after the cache adapter.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

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

---

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