CQRS.NET  4.0
A lightweight enterprise Function as a Service (FaaS) framework to write function based serverless and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.
Cqrs.Akka.Commands.AkkaCommandBus< TAuthenticationToken > Class Template Reference

A ICommandPublisher<TAuthenticationToken> that resolves handlers , executes the handler and then publishes the ICommand<TAuthenticationToken> on the public command bus. More...

+ Inheritance diagram for Cqrs.Akka.Commands.AkkaCommandBus< TAuthenticationToken >:

Public Member Functions

 AkkaCommandBus (IBusHelper busHelper, IAuthenticationTokenHelper< TAuthenticationToken > authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IDependencyResolver dependencyResolver, ILogger logger, ICommandPublisher< TAuthenticationToken > commandPublisher, ICommandReceiver< TAuthenticationToken > commandReceiver)
 Instantiates a new instance of AkkaCommandBus<TAuthenticationToken> More...
 
virtual void Publish< TCommand > (TCommand command)
 Publishes the provided command on the command bus. More...
 
virtual void Publish< TCommand > (IEnumerable< TCommand > commands)
 Publishes the provided commands on the command bus. More...
 
virtual TEvent PublishAndWait< TCommand, TEvent > (TCommand command, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Publishes the provided command and waits for an event of TEvent More...
 
virtual TEvent PublishAndWait< TCommand, TEvent > (TCommand command, int millisecondsTimeout, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Publishes the provided command and waits for an event of TEvent or exits if the specified timeout is expired. More...
 
virtual TEvent PublishAndWait< TCommand, TEvent > (TCommand command, TimeSpan timeout, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Publishes the provided command and waits for an event of TEvent or exits if the specified timeout is expired. More...
 
virtual TEvent PublishAndWait< TCommand, TEvent > (TCommand command, Func< IEnumerable< IEvent< TAuthenticationToken >>, TEvent > condition, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Publishes the provided command and waits until the specified condition is satisfied an event of TEvent More...
 
virtual TEvent PublishAndWait< TCommand, TEvent > (TCommand command, Func< IEnumerable< IEvent< TAuthenticationToken >>, TEvent > condition, int millisecondsTimeout, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Publishes the provided command and waits for an event of TEvent or exits if the specified timeout is expired. More...
 
virtual TEvent PublishAndWait< TCommand, TEvent > (TCommand command, Func< IEnumerable< IEvent< TAuthenticationToken >>, TEvent > condition, TimeSpan timeout, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Publishes the provided command and waits for an event of TEvent or exits if the specified timeout is expired. More...
 
void RegisterHandler< TMessage > (Action< TMessage > handler, Type targetedType, bool holdMessageLock=true)
 Register an event or command handler that will listen and respond to events or commands. More...
 
void RegisterHandler< TMessage > (Action< TMessage > handler, bool holdMessageLock=true)
 Register an event or command handler that will listen and respond to events or commands. More...
 

Protected Member Functions

virtual void PrepareCommand< TCommand > (TCommand command)
 Sets the IMessageWithAuthenticationToken<TAuthenticationToken>.AuthenticationToken, IMessage.CorrelationId, IMessage.OriginatingFramework to "Akka" and adds a value of "Akka" to the IMessage.Frameworks if not already done so More...
 
virtual bool PrepareAndValidateCommand< TCommand > (TCommand command, out RouteHandlerDelegate commandHandler)
 Locates a suitable ICommandValidator<TAuthenticationToken,TCommand> to validate the provided command and validates the provided command if one is located Calls PrepareCommand<TCommand> Checks if the provided command is required to be processed Locates a single command handler for the provided command More...
 

Properties

static RouteManager Routes [get]
 Gets the RouteManager More...
 
IAuthenticationTokenHelper< TAuthenticationToken > AuthenticationTokenHelper [get]
 Gets or sets the Authentication Token Helper More...
 
ICorrelationIdHelper CorrelationIdHelper [get]
 Gets or sets the ICorrelationIdHelper More...
 
IDependencyResolver DependencyResolver [get]
 Gets or sets the IDependencyResolver More...
 
IBusHelper BusHelper [get]
 Gets or sets the IBusHelper More...
 
ILogger Logger [get]
 Gets or sets the ILogger More...
 
ICommandPublisher< TAuthenticationToken > CommandPublisher [get]
 Gets or sets the ICommandPublisher<TAuthenticationToken> More...
 
ICommandReceiver< TAuthenticationToken > CommandReceiver [get]
 Gets or sets the ICommandReceiver<TAuthenticationToken> More...
 
IDictionary< Guid, IList< IEvent< TAuthenticationToken > > > EventWaits [get]
 Gets or sets the current list of events waiting to be evaluated for PublishAndWait<TCommand,TEvent>(TCommand,Cqrs.Events.IEventReceiver<TAuthenticationToken>) More...
 

Detailed Description

A ICommandPublisher<TAuthenticationToken> that resolves handlers , executes the handler and then publishes the ICommand<TAuthenticationToken> on the public command bus.

Template Parameters
TAuthenticationTokenThe Type of the authentication token.