Async broadcaster process that publishes %ASM.Event{} outside run-critical paths.
Design notes:
- enqueue path uses
GenServer.cast/2and never blocks callers - dispatch runs in monitored async tasks
- bounded queue with drop policy protects against unbounded mailbox growth
Summary
Functions
Returns a specification to start this module under a supervisor.
Types
@type overflow_policy() :: :drop_oldest | :drop_newest
@type state() :: %ASM.Extensions.PubSub.Broadcaster{ adapter_mod: module(), adapter_state: ASM.Extensions.PubSub.Adapter.state(), inflight_pid: pid() | nil, inflight_ref: reference() | nil, max_queue_size: pos_integer(), notify: pid() | nil, overflow: overflow_policy(), payload_builder: (ASM.Event.t(), keyword() -> ASM.Extensions.PubSub.Payload.t()), queue: :queue.queue(), queue_len: non_neg_integer(), task_supervisor: pid(), topic_prefix: String.t(), topic_scopes: [ASM.Extensions.PubSub.Topic.scope()], waiters: [GenServer.from()] }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec enqueue(pid(), ASM.Event.t(), keyword()) :: :ok
@spec flush(pid(), timeout()) :: :ok | {:error, ASM.Error.t()}
@spec start_link(keyword()) :: GenServer.on_start() | {:error, ASM.Error.t()}