Ferricstore.Stream.ActivityLog (ferricstore v0.7.5)

Copy Markdown View Source

Metadata-only ring buffer for recent Stream mutations.

Stream entries can contain application payloads. This log intentionally keeps only command shape, stream key, entry ID/counts, and safe option metadata.

Summary

Types

entry()

@type entry() :: %{
  id: non_neg_integer(),
  timestamp_us: integer(),
  command: binary(),
  role: :producer | :consumer | :maintenance,
  key: binary(),
  result: binary(),
  entry_id: binary() | nil,
  count: non_neg_integer() | nil,
  field_pairs: non_neg_integer() | nil,
  trim: binary() | nil,
  group: binary() | nil,
  consumer: binary() | nil,
  nomkstream: boolean() | nil
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get(count \\ 128)

@spec get(non_neg_integer() | nil) :: [entry()]

len()

@spec len() :: non_neg_integer()

record_xack(key, group, acked_count)

@spec record_xack(binary(), binary(), non_neg_integer()) :: :ok

record_xadd(key, entry_id, field_pair_count, trim_opts, nomkstream)

@spec record_xadd(binary(), binary(), non_neg_integer(), term(), boolean()) :: :ok

record_xdel(key, deleted_count)

@spec record_xdel(binary(), non_neg_integer()) :: :ok

record_xread(stream_ids, result)

@spec record_xread([{binary(), binary()}], term()) :: :ok

record_xreadgroup(group, consumer, stream_ids, result)

@spec record_xreadgroup(binary(), binary(), [{binary(), binary()}], term()) :: :ok

record_xtrim(key, deleted_count, trim_opts)

@spec record_xtrim(binary(), non_neg_integer(), term()) :: :ok

reset()

@spec reset() :: :ok

start_link(opts \\ [])

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