3using System.Threading.Tasks;
58 Task<NotificationRecord?>
WaitForAsync(Func<NotificationRecord, bool> Predicate, TimeSpan Timeout, CancellationToken CancellationToken);
66 Task
ExpectAsync(Func<NotificationRecord, bool> Predicate, TimeSpan Timeout, CancellationToken CancellationToken);
89 IDisposable
AddIgnoreFilter(Func<NotificationIntent, NotificationFilterDecision> Predicate);
104 Task
DeleteAsync(IEnumerable<string> Ids, CancellationToken CancellationToken);
Platform-neutral intent describing how to route a notification.
Query options for retrieving notifications.
A service that can be loaded and unloaded at will. Typically during startup and shutdown of an applic...
Interface for the redesigned notification service.
Task PruneAsync(CancellationToken CancellationToken)
Applies retention pruning.
Task MarkReadAsync(string Id, CancellationToken CancellationToken)
Marks a notification as read without consuming it.
Task< NotificationRecord?> WaitForAsync(Func< NotificationRecord, bool > Predicate, TimeSpan Timeout, CancellationToken CancellationToken)
Awaits a notification matching the predicate within a timeout.
string ComputeId(NotificationIntent Intent, NotificationSource Source)
Computes the stable identifier for an intent using the same logic as storage.
Task ExpectAsync(Func< NotificationRecord, bool > Predicate, TimeSpan Timeout, CancellationToken CancellationToken)
Registers an expectation that will auto-route a matching notification when it arrives.
Task MarkConsumedAsync(string Id, CancellationToken CancellationToken)
Marks a notification as consumed without routing it.
Task AddAsync(NotificationIntent Intent, NotificationSource Source, string? RawPayload, CancellationToken CancellationToken)
Adds or updates a notification based on the provided intent.
IDisposable AddIgnoreFilter(Func< NotificationIntent, NotificationFilterDecision > Predicate)
Adds a runtime ignore filter. Dispose the handle to remove it.
Task ProcessPendingAsync(CancellationToken CancellationToken)
Attempts to route any pending deferred intents.
Task ConsumeAsync(string Id, CancellationToken CancellationToken)
Marks a notification as consumed and routes it.
Task DeleteAsync(IEnumerable< string > Ids, CancellationToken CancellationToken)
Deletes notifications by identifier.
EventHandlerAsync< NotificationRecordEventArgs >? OnNotificationAdded
Event raised when a notification is added or updated.
Task< IReadOnlyList< NotificationRecord > > GetAsync(NotificationQuery Query, CancellationToken CancellationToken)
Retrieves notifications matching the query with optional paging.
IReadOnlyDictionary< string, int > ChannelCounts
Current counts per channel.
NotificationSource
Describes the source producing a notification.