Show / Hide Table of Contents

Interface IEventHub

Contract for the singleton application service handling in-process event publishing/subscribing.

Namespace: Kephas.Interaction
Assembly: Kephas.Core.dll
Syntax
[SingletonAppServiceContract]
public interface IEventHub

Methods

| Improve this Doc View Source

PublishAsync(Object, IContext, CancellationToken)

Publishes the event asynchronously to its subscribers.

Declaration
Task PublishAsync(object event, IContext context, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Object event

The event.

IContext context

The context.

System.Threading.CancellationToken cancellationToken

Optional. The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

An asynchronous result.

| Improve this Doc View Source

Subscribe(ITypeInfo, Func<Object, IContext, CancellationToken, Task>)

Subscribes to the event(s) matching the provided type.

Declaration
IEventSubscription Subscribe(ITypeInfo typeMatch, Func<object, IContext, CancellationToken, Task> callback)
Parameters
Type Name Description
ITypeInfo typeMatch

Specifies the type match criteria.

System.Func<System.Object, IContext, System.Threading.CancellationToken, System.Threading.Tasks.Task> callback

The callback.

Returns
Type Description
IEventSubscription

An IEventSubscription.

| Improve this Doc View Source

Subscribe(Func<Object, Boolean>, Func<Object, IContext, CancellationToken, Task>)

Subscribes to the event(s) matching the criteria.

Declaration
IEventSubscription Subscribe(Func<object, bool> match, Func<object, IContext, CancellationToken, Task> callback)
Parameters
Type Name Description
System.Func<System.Object, System.Boolean> 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.

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
EventHubExtensions.Subscribe<TEvent>(IEventHub, Func<TEvent, IContext, CancellationToken, Task>)
EventHubExtensions.Subscribe<TEvent>(IEventHub, Action<TEvent, IContext>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
MessagingEventHubExtensions.Subscribe<TEvent>(IEventHub, Func<TEvent, IContext, CancellationToken, Task>, MessageTypeMatching)
MessagingEventHubExtensions.Subscribe<TEvent>(IEventHub, Action<TEvent, IContext>, MessageTypeMatching)
MessagingEventHubExtensions.Subscribe(IEventHub, IMessageMatch, Func<Object, IContext, CancellationToken, Task>)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX