corvix.notifications.dispatcher

Fan-out dispatcher: delivers notification events to all enabled targets.

Attributes

Classes

NotificationDispatcher

Fan-out delivery to a list of NotificationTarget instances.

Module Contents

corvix.notifications.dispatcher.logger[source][source]
class corvix.notifications.dispatcher.NotificationDispatcher(targets: list[corvix.notifications.targets.base.NotificationTarget])[source][source]

Fan-out delivery to a list of NotificationTarget instances.

Each target is called independently; a failure in one target never prevents others from receiving events. Results are aggregated into a DispatchResult for the caller (typically run_poll_cycle).

Usage:

dispatcher = NotificationDispatcher(targets=[my_target])
result = dispatcher.dispatch(events)
_targets[source][source]
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.