pub async fn run_deliverer(
rx: Receiver<Event>,
targets: Receiver<Arc<Vec<WebhookTarget>>>,
obs: Arc<Observability>,
shutdown: Receiver<()>,
durability: Option<Arc<dyn EventDurability>>,
)Expand description
The deliverer loop (DW-044): drain the bus, filter by kind, dispatch one bounded-concurrency delivery task per (event, target). Returns on shutdown (pending queue abandoned — documented: the gateway is not a durable queue) or when the bus closes.
REL-14 (#249): when a durability layer is provided, the deliverer marks each event as acked after dispatching to matching targets. This gives at-least-once semantics on restart: an event that was persisted to the WAL but not yet acked is replayed on the next startup.
Spawned by the DataPlane
(DataPlane::spawn_webhook_deliverer) so the binary and tests share
one wiring path.