GenPETS (gen_pets v0.1.0)
Summary
Functions
Returns a specification to start this module under a supervisor.
Starts a GenPETS process without links.
Starts a GenPETS process linked to the current process.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec delete(GenServer.server(), key()) :: :ok
@spec direct_delete(:ets.table(), key()) :: :ok
@spec direct_prune(:ets.table()) :: :ok
@spec direct_read(:ets.table(), key()) :: [key_value()]
@spec direct_write(:ets.table(), key(), value()) :: :ok
@spec exists?(:ets.table(), key()) :: boolean()
@spec exists?(GenServer.server(), key()) :: boolean()
@spec prune(GenServer.server()) :: :ok
@spec read(GenServer.server(), key()) :: [key_value()]
Starts a GenPETS process without links.
See start_link/1
for more information
Starts a GenPETS process linked to the current process.
# Start a new GenPETS: iex(1)> {:ok, pid} = GenPETS.start(table_name: :some_table_name, file_path: "some_file_path")
# Control using the provided PID: iex(2)> GenPETS.write(pid, :key, :value) :ok
# Alternatively, you can use your table_name as well: iex(3)> GenPETS.read(:some_table_name, :key) [key: :value]
@spec write(GenServer.server(), key(), value()) :: :ok