Class MessagingEventHubExtensions
Extension methods for IEventHub.
Inheritance
System.Object
MessagingEventHubExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Messaging.Events
Assembly: Kephas.Messaging.dll
Syntax
public static class MessagingEventHubExtensions
Methods
| Improve this Doc View SourceSubscribe(IEventHub, IMessageMatch, Func<Object, IContext, CancellationToken, Task>)
Subscribes to the event(s) matching the criteria.
Declaration
public static IEventSubscription Subscribe(this IEventHub eventHub, IMessageMatch match, Func<object, IContext, CancellationToken, Task> callback)
Parameters
Type | Name | Description |
---|---|---|
IEventHub | eventHub | The eventHub to act on. |
IMessageMatch | match | Specifies the match criteria. |
System.Func<System.Object, IContext, System.Threading.CancellationToken, System.Threading.Tasks.Task> | callback | The callback. |
Returns
Type | Description |
---|---|
IEventSubscription | An IEventSubscription. |
Subscribe<TEvent>(IEventHub, Action<TEvent, IContext>, MessageTypeMatching)
Subscribes to the event with the provided type.
Declaration
public static IEventSubscription Subscribe<TEvent>(this IEventHub eventHub, Action<TEvent, IContext> callback, MessageTypeMatching messageTypeMatching)
where TEvent : class
Parameters
Type | Name | Description |
---|---|---|
IEventHub | eventHub | The eventHub to act on. |
System.Action<TEvent, IContext> | callback | The callback. |
MessageTypeMatching | messageTypeMatching | Optional. The message type matching. |
Returns
Type | Description |
---|---|
IEventSubscription | An IEventSubscription. |
Type Parameters
Name | Description |
---|---|
TEvent | Type of the event. |
Subscribe<TEvent>(IEventHub, Func<TEvent, IContext, CancellationToken, Task>, MessageTypeMatching)
Subscribes to the event with the provided type.
Declaration
public static IEventSubscription Subscribe<TEvent>(this IEventHub eventHub, Func<TEvent, IContext, CancellationToken, Task> callback, MessageTypeMatching messageTypeMatching)
where TEvent : class
Parameters
Type | Name | Description |
---|---|---|
IEventHub | eventHub | The eventHub to act on. |
System.Func<TEvent, IContext, System.Threading.CancellationToken, System.Threading.Tasks.Task> | callback | The callback. |
MessageTypeMatching | messageTypeMatching | Optional. The message type matching. |
Returns
Type | Description |
---|---|
IEventSubscription | An IEventSubscription. |
Type Parameters
Name | Description |
---|---|
TEvent | Type of the event. |