Templates.DistrServer (Beethoven v0.3.9)

Summary

Functions

Returns a specification to start this module under a supervisor.

Similar to :mnesia.dirty_select/2 but only needs the match spec as an argument. The table name of the DistrServer Elixir.Templates.DistrServer's mnesia table is input automatically as the 1st arity.

Fetches data from the DistrServer Elixir.Templates.DistrServer's mnesia table. Uses a record key to query the data. Will return all matching records.

Fetches all records from the DistrServer Elixir.Templates.DistrServer's mnesia table.

Returns the name of the DistrServer Elixir.Templates.DistrServer's mnesia table.

Supervisor Entry point.

Subscribes to the table mapped to the DistrServer Elixir.Templates.DistrServer's mnesia table.

Checks if the DistrServer Elixir.Templates.DistrServer's mnesia table exists.

Holds the thread until the DistrServer Elixir.Templates.DistrServer's mnesia table becomes available, or timeout occurs. Defaults to 1_000 milliseconds for timeouts and 15 milliseconds for checking intervals.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

dirty_select(matchSpec)

@spec dirty_select(:ets.match_spec()) :: [tuple()] | list()

Similar to :mnesia.dirty_select/2 but only needs the match spec as an argument. The table name of the DistrServer Elixir.Templates.DistrServer's mnesia table is input automatically as the 1st arity.

fetch(key)

@spec fetch(any()) :: [tuple()] | list()

Fetches data from the DistrServer Elixir.Templates.DistrServer's mnesia table. Uses a record key to query the data. Will return all matching records.

fetch_all()

@spec fetch_all() :: [tuple()] | list()

Fetches all records from the DistrServer Elixir.Templates.DistrServer's mnesia table.

get_table_name()

@spec get_table_name() :: module() | atom()

Returns the name of the DistrServer Elixir.Templates.DistrServer's mnesia table.

start_link(init_args \\ [])

@spec start_link(any()) :: GenServer.on_start()

Supervisor Entry point.

subscribe(type \\ :simple)

@spec subscribe(:simple | :detailed) :: :ok

Subscribes to the table mapped to the DistrServer Elixir.Templates.DistrServer's mnesia table.

Matches based on subscription

:simple

{:mnesia_table_event, {:atom, record(), _op_data}}

:detailed

{:mnesia_table_event, {:atom, module() | :atom(), record(), [] | [record()], _op_data}}

table_exists?()

@spec table_exists?() :: boolean()

Checks if the DistrServer Elixir.Templates.DistrServer's mnesia table exists.

until_exists(int \\ 15, timeout \\ 1000, acc \\ 0)

Holds the thread until the DistrServer Elixir.Templates.DistrServer's mnesia table becomes available, or timeout occurs. Defaults to 1_000 milliseconds for timeouts and 15 milliseconds for checking intervals.