Keyfob.Store.ETS (Keyfob v0.1.0)

Copy Markdown View Source

The built-in single-node store: one ETS table owned by a GenServer.

Reads (get/1) hit ETS directly; writes and the atomicity-sensitive operations (update/2, take/1) serialize through the GenServer — login traffic is low-volume, so a single serialization point is the simplest correct design. Expired entries are treated as missing on read and swept every :sweep_interval_ms (default 30s).

Add it to your supervision tree:

children = [
  Keyfob.Store.ETS,
  ...
]

Single-node only: requests created on one node are invisible to another. For clusters, implement Keyfob.Store over shared storage.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])