Class EventHubExtensions
Extensions for IEventHub.
Inheritance
System.Object
EventHubExtensions
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.Interaction
Assembly: Kephas.Core.dll
Syntax
public static class EventHubExtensions
Methods
| Improve this Doc View SourceSubscribe<TEvent>(IEventHub, Action<TEvent, IContext>)
Subscribes to the event(s) matching the provided type.
Declaration
public static IEventSubscription Subscribe<TEvent>(this IEventHub eventHub, Action<TEvent, IContext> callback)
where TEvent : class
Parameters
Type | Name | Description |
---|---|---|
IEventHub | eventHub | The event hub to act on. |
System.Action<TEvent, IContext> | callback | The callback. |
Returns
Type | Description |
---|---|
IEventSubscription | An IEventSubscription. |
Type Parameters
Name | Description |
---|---|
TEvent | Type of the event. |
Subscribe<TEvent>(IEventHub, Func<TEvent, IContext, CancellationToken, Task>)
Subscribes to the event(s) matching the provided type.
Declaration
public static IEventSubscription Subscribe<TEvent>(this IEventHub eventHub, Func<TEvent, IContext, CancellationToken, Task> callback)
where TEvent : class
Parameters
Type | Name | Description |
---|---|---|
IEventHub | eventHub | The event hub to act on. |
System.Func<TEvent, IContext, System.Threading.CancellationToken, System.Threading.Tasks.Task> | callback | The callback. |
Returns
Type | Description |
---|---|
IEventSubscription | An IEventSubscription. |
Type Parameters
Name | Description |
---|---|
TEvent | Type of the event. |