Bedrock.DataPlane.Demux.PersistenceWorker (bedrock v0.6.0)

View Source

Minimal async persistence worker scaffolding built on PersistenceQueue.

The worker is intentionally generic in this foundational slice. It processes payloads with an injected :perform function and handles bounded retries.

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

state()

@type state() :: %Bedrock.DataPlane.Demux.PersistenceWorker{
  on_drop: (payload :: term(), reason :: term() -> any()) | nil,
  perform: (term() -> :ok | {:error, term()}),
  queue: Bedrock.DataPlane.Demux.PersistenceQueue.t(),
  retry_tick_ms: pos_integer()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

enqueue(server, payload)

@spec enqueue(GenServer.server(), term()) :: :ok | {:error, :queue_full}

start_link(opts)

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

stats(server)