# `Lightning.Adaptors.Invalidator`
[🔗](https://github.com/OpenFn/lightning/blob/main/lib/lightning/adaptors/invalidator.ex#L1)

Subscribes to cluster adaptor-change broadcasts and evicts matching
local Cachex entries, keeping each node coherent with Postgres.

Subscribes to `opts[:source_topic]` on `Lightning.PubSub` at init. On
`{:changed, name, source}` it deletes every cache key
`Lightning.Adaptors.Store` writes for that name, plus the source-wide
`:packages` and `:catalogue` keys, which any change invalidates.
Dropping `:icon_bytes` is what lets a committed icon error clear. Only
the row moving can resolve it, and the row moving always broadcasts.
There is no source filtering. A broadcast for a source not active on
this node deletes keys that do not exist, which is a no-op.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

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

Start the Invalidator linked to the calling process.

Required opts:
  * `:name` - registered process name.
  * `:source_topic` - `Phoenix.PubSub` topic to subscribe to.
  * `:cache` - Cachex table atom, from `Lightning.Adaptors.Supervisor.cache_name/1`.

---

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