corvix.notifications.dispatcher¶
Fan-out dispatcher: delivers notification events to all enabled targets.
Attributes¶
Classes¶
Fan-out delivery to a list of |
Module Contents¶
- class corvix.notifications.dispatcher.NotificationDispatcher(targets: list[corvix.notifications.targets.base.NotificationTarget])[source][source]¶
Fan-out delivery to a list of
NotificationTargetinstances.Each target is called independently; a failure in one target never prevents others from receiving events. Results are aggregated into a
DispatchResultfor the caller (typicallyrun_poll_cycle).Usage:
dispatcher = NotificationDispatcher(targets=[my_target]) result = dispatcher.dispatch(events)
- dispatch(events: list[corvix.notifications.models.NotificationEvent]) corvix.notifications.models.DispatchResult[source][source]¶
Deliver events to all registered targets.
If events is empty the dispatcher is a no-op and returns an empty
DispatchResult.