In-memory ETS implementation of Rheo.Backend.
Always available (no optional dependency). Prefer for tests, Livebook, local demos, and ephemeral apps. Prefer Mongo, Ecto, Redis, or Mnesia when events must survive process or node restart.
Prefer the Rheo facade for application code. The opaque handle is this
process's registered name (default Rheo.ETS), started via child_spec/1.
When to use
- Unit and contract tests that need a real backend without external services
- Livebook / Notebook prototypes
- Single-node apps where loss on restart is acceptable
Do not use when durability or multi-node lease arbitration is required
(durable: false, distributed: false).
Capabilities
durable: false— tables die with the owner GenServer / nodedistributed: false— not shared across BEAM nodesbatch_writes: true,ordered_range_scan: truereplay: true,partitions: true,contiguous_frontier: truesecondary_indexes: false—query/2filters in-processnotifications: false,atomic_compare_and_set: false
Tables
Per-instance protected ETS tables owned by this GenServer:
streams / events / groups / deliveries
event_ids / delivery_by_seq / open_deliveriesOptions
:name— handle / process name (defaultdefault_handle/0)
Supervision example
children = [
{Rheo, name: MyRheo, backend: Rheo.Backend.ETS}
]Named handle:
children = [
{Rheo, name: MyRheo, backend: {Rheo.Backend.ETS, name: MyRheo.ETS}}
]Callback semantics are documented on Rheo.Backend.
Summary
Functions
@spec child_spec(keyword()) :: Supervisor.child_spec()
Child spec for the ETS GenServer (backend handle).
Arguments
opts— keyword options::name— handle / process name (defaultdefault_handle/0)
Examples
iex> spec = Rheo.Backend.ETS.child_spec(name: :demo_ets)
iex> {spec.id, elem(spec.start, 0), spec.type}
{{Rheo.Backend.ETS, :demo_ets}, Rheo.Backend.ETS, :worker}Returns
A supervisor child spec map.
@spec default_handle() :: atom()
Default ETS handle name for the Rheo instance.
Examples
iex> Rheo.Backend.ETS.default_handle()
Rheo.ETSReturns
A process name atom (Rheo.ETS).