Show / Hide Table of Contents

Class DefaultEventHub

The default implementation of the IEventHub service.

Inheritance
System.Object
Loggable
DefaultEventHub
MessagingEventHub
Implements
ILoggable
IEventHub
System.IDisposable
Inherited Members
Loggable.Logger
Loggable.GetLogger()
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
[OverridePriority(Priority.Low)]
public class DefaultEventHub : Loggable, ILoggable, IEventHub, IDisposable

Methods

| Improve this Doc View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Improve this Doc View Source

Dispose(Boolean)

Releases the unmanaged resources used by the Kephas.Interaction.DefaultEventHub and optionally releases the managed resources.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

True to release both managed and unmanaged resources; false to release only unmanaged resources.

| Improve this Doc View Source

GetEventContent(Object)

Gets the event content.

Declaration
protected virtual object GetEventContent(object event)
Parameters
Type Name Description
System.Object event

The event.

Returns
Type Description
System.Object

The event content.

| Improve this Doc View Source

GetTypeMatch(ITypeInfo)

Gets the match for the provided event type.

Declaration
protected virtual Func<object, bool> GetTypeMatch(ITypeInfo typeMatch)
Parameters
Type Name Description
ITypeInfo typeMatch

Specifies the type match criteria.

Returns
Type Description
System.Func<System.Object, System.Boolean>

A function delegate that yields a bool.

| Improve this Doc View Source

PublishAsync(Object, IContext, CancellationToken)

Publishes the event asynchronously to its subscribers.

Declaration
public virtual 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
public virtual 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
public virtual 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 event match criteria.

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

The callback.

Returns
Type Description
IEventSubscription

An IEventSubscription.

Implements

ILoggable
IEventHub
System.IDisposable

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