Foundation.Services.EventStore (foundation v0.1.0)

Event storage service implementation using GenServer.

Provides persistent event storage with querying capabilities.

Summary

Functions

Returns a specification to start this module under a supervisor.

Reset all stored events and metrics for testing purposes.

Types

server_state()

@type server_state() :: %{
  events: %{required(non_neg_integer()) => Foundation.Types.Event.t()},
  next_id: non_neg_integer(),
  metrics: map()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

initialize(opts)

@spec initialize(keyword()) :: :ok | {:error, Foundation.Types.Error.t()}

reset_state()

@spec reset_state() :: :ok | {:error, Foundation.Types.Error.t()}

Reset all stored events and metrics for testing purposes.

This function should only be used in test environments.

start_link(opts \\ [])

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

stop()

@spec stop() :: :ok