Ferricstore.PubSub.ActivityLog (ferricstore v0.7.5)

Copy Markdown View Source

Metadata-only ring buffer for Pub/Sub activity.

Message payloads are intentionally not stored. Publish entries keep only channel, message byte size, and receiver count.

Summary

Types

entry()

@type entry() :: %{
  id: non_neg_integer(),
  timestamp_us: integer(),
  command: binary(),
  target_type: :channel | :pattern,
  target: binary(),
  targets: non_neg_integer(),
  subscribers: non_neg_integer() | nil,
  message_bytes: non_neg_integer() | 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()]

record_publish(channel, message_bytes, subscribers)

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

record_subscription(command, target_type, targets)

@spec record_subscription(binary(), :channel | :pattern, [binary()]) :: :ok

reset()

@spec reset() :: :ok

start_link(opts \\ [])

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