# `Attesto.DeviceCodeStore.ETS`
[🔗](https://github.com/XukuLLC/attesto/blob/v0.13.0/lib/attesto/device_code_store/ets.ex#L1)

Single-node ETS implementation of `Attesto.DeviceCodeStore`.

Device-code records live in an ETS table owned by a `GenServer`. The
state-changing callbacks (`approve/2`, `deny/2`, `poll/2`, `consume/2`) run
inside `GenServer.call/2`, so they are serialized through the owner process —
that is how this reference store gets the atomic, single-winner state
transitions `Attesto.DeviceCodeStore` requires (a production multi-node
deployment uses the Ecto store, whose transitions are single conditional
`UPDATE ... RETURNING` statements). Reads that do not transition state
(`lookup_user_code/1`) hit the table directly.

## Start options

  * `:sweep_interval_ms` (default `30_000`) - how often expired rows are
    bulk-deleted. Correctness does not depend on sweeping (`redeem/4`
    re-checks expiry); the sweeper only bounds table size.

## Wiring

    children = [Attesto.DeviceCodeStore.ETS]

# `start_link`

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

---

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