Interface INotificationService
Defines methods to publish notifications.
Namespace: Sartorius.SAF.Notification
Assembly: Sartorius.SAF.dll
Syntax
public interface INotificationService
Methods
View SourcePublish<T>(T)
Publishes the specific notification.
Declaration
void Publish<T>(T notification)
Parameters
Type | Name | Description |
---|---|---|
T | notification | The payload. |
Type Parameters
Name | Description |
---|---|
T | The |
Subscribe<T>(Action<T>)
Subscribes the action
to the notifications of T
.
Declaration
SubscriptionToken Subscribe<T>(Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | action | The System.Action<T> that is invoked when the notification is published. |
Returns
Type | Description |
---|---|
SubscriptionToken |
Type Parameters
Name | Description |
---|---|
T | The notification type. |
Subscribe<T>(Action<T>, Predicate<T>)
Subscribes the action
with the given filter
to the notifications of T
.
Declaration
SubscriptionToken Subscribe<T>(Action<T> action, Predicate<T> filter)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | action | The System.Action<T> that is invoked when the notification is published. |
System.Predicate<T> | filter | The filter System.Predicate<T> that defines whether the notification is published to the subscriber. |
Returns
Type | Description |
---|---|
SubscriptionToken |
Type Parameters
Name | Description |
---|---|
T | The payload type. |
Unsubscribe(SubscriptionToken)
Removes the subscriber matching the SubscriptionToken.
Declaration
void Unsubscribe(SubscriptionToken subscriptionToken)
Parameters
Type | Name | Description |
---|---|---|
SubscriptionToken | subscriptionToken | The SubscriptionToken. |