Class AkkaEventBus<TAuthenticationToken>
An IEventPublisher<TAuthenticationToken> that proxies IEvent<TAuthenticationToken> back onto the Akka.Actor.IActorRef and then publishes the IEvent<TAuthenticationToken> on the public event bus.
Inheritance
Inherited Members
Namespace: Cqrs.Akka.Events
Assembly: Cqrs.Akka.dll
Syntax
public class AkkaEventBus<TAuthenticationToken> : IAkkaEventPublisher<TAuthenticationToken>, IEventPublisher<TAuthenticationToken>, IEventHandlerRegistrar, IHandlerRegistrar
Type Parameters
Name | Description |
---|---|
TAuthenticationToken |
Constructors
AkkaEventBus(IBusHelper, IAuthenticationTokenHelper<TAuthenticationToken>, ICorrelationIdHelper, ILogger, IEventPublisher<TAuthenticationToken>, IEventReceiver<TAuthenticationToken>)
Instantiates a new instance of AkkaEventBus<TAuthenticationToken>
Declaration
public AkkaEventBus(IBusHelper busHelper, IAuthenticationTokenHelper<TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IEventPublisher<TAuthenticationToken> eventPublisher, IEventReceiver<TAuthenticationToken> eventReceiver)
Parameters
Type | Name | Description |
---|---|---|
IBusHelper | busHelper | |
IAuthenticationTokenHelper<TAuthenticationToken> | authenticationTokenHelper | |
cdmdotnet.Logging.ICorrelationIdHelper | correlationIdHelper | |
cdmdotnet.Logging.ILogger | logger | |
IEventPublisher<TAuthenticationToken> | eventPublisher | |
IEventReceiver<TAuthenticationToken> | eventReceiver |
Properties
AuthenticationTokenHelper
Gets or sets the IAuthenticationTokenHelper<TAuthenticationToken>
Declaration
protected IAuthenticationTokenHelper<TAuthenticationToken> AuthenticationTokenHelper { get; }
Property Value
Type | Description |
---|---|
IAuthenticationTokenHelper<TAuthenticationToken> |
BusHelper
Gets or sets the IBusHelper
Declaration
protected IBusHelper BusHelper { get; }
Property Value
Type | Description |
---|---|
IBusHelper |
CorrelationIdHelper
Gets or sets the cdmdotnet.Logging.ICorrelationIdHelper
Declaration
protected ICorrelationIdHelper CorrelationIdHelper { get; }
Property Value
Type | Description |
---|---|
cdmdotnet.Logging.ICorrelationIdHelper |
EventPublisher
Gets or sets the IEventPublisher<TAuthenticationToken>
Declaration
protected IEventPublisher<TAuthenticationToken> EventPublisher { get; }
Property Value
Type | Description |
---|---|
IEventPublisher<TAuthenticationToken> |
EventReceiver
Gets or sets the IEventReceiver<TAuthenticationToken>
Declaration
protected IEventReceiver<TAuthenticationToken> EventReceiver { get; }
Property Value
Type | Description |
---|---|
IEventReceiver<TAuthenticationToken> |
Logger
Gets or sets the cdmdotnet.Logging.ILogger
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
cdmdotnet.Logging.ILogger |
Routes
Gets the RouteManager
Declaration
protected static RouteManager Routes { get; }
Property Value
Type | Description |
---|---|
RouteManager |
Methods
PrepareAndValidateEvent<TEvent>(TEvent, String, out IEnumerable<RouteHandlerDelegate>)
Prepares and validates an IEvent<TAuthenticationToken> to be sent specifying the framework it is sent via.
Declaration
public virtual bool PrepareAndValidateEvent<TEvent>(TEvent event, string framework, out IEnumerable<RouteHandlerDelegate> handlers)where TEvent : IEvent<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TEvent | event | The IEvent<TAuthenticationToken> to send. |
System.String | framework | The framework the |
System.Collections.Generic.IEnumerable<RouteHandlerDelegate> | handlers | The located RouteHandlerDelegate to be executed by passing the |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
TEvent | The System.Type ofIEvent<TAuthenticationToken> being sent. |
PrepareEvent<TEvent>(TEvent, String)
Prepares an IEvent<TAuthenticationToken> to be sent specifying the framework it is sent via.
Declaration
public virtual void PrepareEvent<TEvent>(TEvent event, string framework)where TEvent : IEvent<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TEvent | event | The IEvent<TAuthenticationToken> to send. |
System.String | framework | The framework the |
Type Parameters
Name | Description |
---|---|
TEvent | The System.Type ofIEvent<TAuthenticationToken> being sent. |
Publish<TEvent>(TEvent)
Publishes the provided event
on the event bus.
Declaration
public void Publish<TEvent>(TEvent event)where TEvent : IEvent<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TEvent | event |
Type Parameters
Name | Description |
---|---|
TEvent |
Implements
Publish<TEvent>(IEnumerable<TEvent>)
Publishes the provided events
on the event bus.
Declaration
public virtual void Publish<TEvent>(IEnumerable<TEvent> events)where TEvent : IEvent<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TEvent> | events |
Type Parameters
Name | Description |
---|---|
TEvent |
Implements
RegisterGlobalEventHandler<TMessage>(Action<TMessage>, Boolean)
Register an event handler that will listen and respond to all events.
Declaration
public void RegisterGlobalEventHandler<TMessage>(Action<TMessage> handler, bool holdMessageLock = true)where TMessage : IMessage
Parameters
Type | Name | Description |
---|---|---|
System.Action<TMessage> | handler | |
System.Boolean | holdMessageLock |
Type Parameters
Name | Description |
---|---|
TMessage |
Implements
RegisterHandler<TMessage>(Action<TMessage>, Boolean)
Register an event or command handler that will listen and respond to events or commands.
Declaration
public void RegisterHandler<TMessage>(Action<TMessage> handler, bool holdMessageLock = true)where TMessage : IMessage
Parameters
Type | Name | Description |
---|---|---|
System.Action<TMessage> | handler | |
System.Boolean | holdMessageLock |
Type Parameters
Name | Description |
---|---|
TMessage |
Implements
RegisterHandler<TMessage>(Action<TMessage>, Type, Boolean)
Register an event or command handler that will listen and respond to events or commands.
Declaration
public void RegisterHandler<TMessage>(Action<TMessage> handler, Type targetedType, bool holdMessageLock = true)where TMessage : IMessage
Parameters
Type | Name | Description |
---|---|---|
System.Action<TMessage> | handler | |
System.Type | targetedType | |
System.Boolean | holdMessageLock |
Type Parameters
Name | Description |
---|---|
TMessage |
Implements
Remarks
In many cases the targetedType
will be the event handler class itself, what you actually want is the target of what is being updated