Dsxir. RuntimeProgram. Store. ETS
(dsxir v0.4.0)
Copy Markdown
ETS-backed in-memory implementation of Dsxir.RuntimeProgram.Store.
A GenServer is used solely to own the named ETS table so that it is
anchored to a supervisor: ETS tables die with their owner. All reads and
writes go directly through :ets, bypassing the GenServer message
queue (the table is :public with :read_concurrency).
The store is opt-in: it is not started by the dsxir application. Users start it under their own supervision tree:
children = [
{Dsxir.RuntimeProgram.Store.ETS,
name: MyStore, table: :my_runtime_program_table}
]:name vs :table
The two options are intentionally distinct:
:nameis the registered name of the owningGenServerprocess (defaults to__MODULE__).:tableis the ETS table atom that callers pass asreftoput/2,get/2, andlist/2(defaults to:dsxir_runtime_program_store).
The ref argument forwarded to Dsxir.RuntimeProgram.from_map/2 via
store: {Dsxir.RuntimeProgram.Store.ETS, ref} MUST be the table atom
(:table opt), NOT the GenServer name. The two are kept separate so the
table can be referenced and queried independently of the owner process
(and the owner can be restarted under supervision without callers having
to know its pid).
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()