ExESDB.StoreManager (ex_esdb v0.1.0)
Manages multiple event stores dynamically within a single ExESDB cluster.
This module provides the API for creating, starting, stopping, and managing multiple stores at runtime. Each store has its own unique identifier and operates independently within the shared cluster infrastructure.
Summary
Functions
Returns a specification to start this module under a supervisor.
Creates and starts a new store with the given store_id and configuration.
Gets the configuration for a specific store.
Gets the status of a specific store.
Lists all currently managed stores and their status.
Stops and removes a store from the manager.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec create_store(store_id(), store_config()) :: {:ok, store_id()} | {:error, term()}
Creates and starts a new store with the given store_id and configuration.
Parameters
store_id
: Unique identifier for the store (atom)config
: Optional configuration overrides (keyword list)
Returns
{:ok, store_id}
if successful{:error, reason}
if failed
@spec get_store_config(store_id()) :: {:ok, store_config()} | {:error, :not_found}
Gets the configuration for a specific store.
Parameters
store_id
: The store identifier
Returns
{:ok, store_config}
if store exists{:error, :not_found}
if store doesn't exist
@spec get_store_status(store_id()) :: {:ok, store_status()} | {:error, :not_found}
Gets the status of a specific store.
Parameters
store_id
: The store identifier
Returns
{:ok, store_status}
if store exists{:error, :not_found}
if store doesn't exist
@spec list_stores() :: map()
Lists all currently managed stores and their status.
Returns
%{store_id => %{status: store_status, config: store_config}}
Stops and removes a store from the manager.
Parameters
store_id
: The store identifier to remove
Returns
:ok
if successful{:error, reason}
if failed