class NotificationService
implements INotifier
Since 0.1.0

NotificationService implements INotifier, fanning out a single NotificationMessage across all requested channels in parallel via Promise.allSettled. If any channel fails, it throws an AggregateError whose members each name their channel (X8-12).

Constructors

NotificationService(channels: Map<string, NotificationChannel>)

Creates a NotificationService with the given channel map.

Parameters
channels: Map<string, NotificationChannel>

Map of channel name to channel instance

Methods

send(notification: NotificationMessage): Promise<void>

Dispatches a notification on every requested channel.

Since 0.1.0
sendSettled(notification: NotificationMessage): Promise<readonly ChannelSendResult[]>

Dispatches a notification on every requested channel and reports the settled outcome of each, without throwing.

Unlike INotifier.send, this never rejects: a failed channel is reported as { channel, ok: false, error } so a caller (typically one behind a retrying queue) can retry the failing channel alone instead of re-sending the whole notification. One result per requested channel, in request order.

Usage

import { NotificationService } from "notification-plugin/src/index.ts";