ExESDB.Store (ex_esdb v0.3.2)

A GenServer wrapper around :khepri to act as a distributed event store.

Summary

Functions

Returns a specification to start this module under a supervisor.

Get the current state of the store.

Get the store-specific GenServer name.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_state(store_id \\ nil)

Get the current state of the store.

Returns

- `{:ok, state}`  if successful.
- `{:error, reason}` if unsuccessful.

start_link(opts)

store_name(store_id)

Get the store-specific GenServer name.

This function returns the name used to register this store GenServer, allowing multiple stores to run on the same node.

Parameters

  • store_id - The store identifier (optional)

Examples

iex> ExESDB.Store.store_name("my_store")
{:ex_esdb_store, "my_store"}

iex> ExESDB.Store.store_name(nil)
ExESDB.Store