Bedrock.DataPlane.Demux.PersistenceWorker (bedrock v0.6.0)
View SourceMinimal 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
@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
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec enqueue(GenServer.server(), term()) :: :ok | {:error, :queue_full}
@spec start_link(keyword()) :: GenServer.on_start()
@spec stats(GenServer.server()) :: Bedrock.DataPlane.Demux.PersistenceQueue.counts()