Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
INotificationServiceV2.cs
2using System.Threading;
3using System.Threading.Tasks;
4using Waher.Events;
6
8{
13 {
21 Task AddAsync(NotificationIntent Intent, NotificationSource Source, string? RawPayload, CancellationToken CancellationToken);
22
28 Task ConsumeAsync(string Id, CancellationToken CancellationToken);
29
35 Task MarkConsumedAsync(string Id, CancellationToken CancellationToken);
36
43 Task<IReadOnlyList<NotificationRecord>> GetAsync(NotificationQuery Query, CancellationToken CancellationToken);
44
49 Task PruneAsync(CancellationToken CancellationToken);
50
58 Task<NotificationRecord?> WaitForAsync(Func<NotificationRecord, bool> Predicate, TimeSpan Timeout, CancellationToken CancellationToken);
59
66 Task ExpectAsync(Func<NotificationRecord, bool> Predicate, TimeSpan Timeout, CancellationToken CancellationToken);
67
71 event EventHandlerAsync<NotificationRecordEventArgs>? OnNotificationAdded;
72
78 Task MarkReadAsync(string Id, CancellationToken CancellationToken);
79
83 IReadOnlyDictionary<string, int> ChannelCounts { get; }
84
89 IDisposable AddIgnoreFilter(Func<NotificationIntent, NotificationFilterDecision> Predicate);
90
98
104 Task DeleteAsync(IEnumerable<string> Ids, CancellationToken CancellationToken);
105
110 Task ProcessPendingAsync(CancellationToken CancellationToken);
111 }
112}
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.