corvix.notifications.dispatcher =============================== .. py:module:: corvix.notifications.dispatcher .. autoapi-nested-parse:: Fan-out dispatcher: delivers notification events to all enabled targets. Attributes ---------- .. autoapisummary:: corvix.notifications.dispatcher.logger Classes ------- .. autoapisummary:: corvix.notifications.dispatcher.NotificationDispatcher Module Contents --------------- .. py:data:: logger .. py:class:: NotificationDispatcher(targets: list[corvix.notifications.targets.base.NotificationTarget]) Fan-out delivery to a list of :class:`NotificationTarget` instances. Each target is called independently; a failure in one target never prevents others from receiving events. Results are aggregated into a :class:`DispatchResult` for the caller (typically ``run_poll_cycle``). Usage:: dispatcher = NotificationDispatcher(targets=[my_target]) result = dispatcher.dispatch(events) .. py:attribute:: _targets .. py:method:: dispatch(events: list[corvix.notifications.models.NotificationEvent]) -> corvix.notifications.models.DispatchResult Deliver *events* to all registered targets. If *events* is empty the dispatcher is a no-op and returns an empty :class:`DispatchResult`.