CQRS.NET  2.1
A lightweight enterprise framework to write CQRS, event-sourced 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 > commandSender, ICommandReceiver< TAuthenticationToken > commandReceiver)
 
virtual void Publish< TCommand > (TCommand command)
 Publishes the provided command on the command bus. More...
 
virtual void Send< TCommand > (TCommand command)
 
virtual void Publish< TCommand > (IEnumerable< TCommand > commands)
 Publishes the provided commands on the command bus. More...
 
virtual void Send< TCommand > (IEnumerable< TCommand > commands)
 
virtual TEvent SendAndWait< TCommand, TEvent > (TCommand command, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Sends the provided command and waits for an event of TEvent More...
 
virtual TEvent SendAndWait< TCommand, TEvent > (TCommand command, int millisecondsTimeout, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Sends the provided command and waits for an event of TEvent or exits if the specified timeout is expired. More...
 
virtual TEvent SendAndWait< TCommand, TEvent > (TCommand command, TimeSpan timeout, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Sends the provided command and waits for an event of TEvent or exits if the specified timeout is expired. More...
 
virtual TEvent SendAndWait< TCommand, TEvent > (TCommand command, Func< IEnumerable< IEvent< TAuthenticationToken >>, TEvent > condition, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Sends the provided command and waits until the specified condition is satisfied an event of TEvent More...
 
virtual TEvent SendAndWait< TCommand, TEvent > (TCommand command, Func< IEnumerable< IEvent< TAuthenticationToken >>, TEvent > condition, int millisecondsTimeout, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Sends the provided command and waits for an event of TEvent or exits if the specified timeout is expired. More...
 
virtual TEvent SendAndWait< TCommand, TEvent > (TCommand command, Func< IEnumerable< IEvent< TAuthenticationToken >>, TEvent > condition, TimeSpan timeout, IEventReceiver< TAuthenticationToken > eventReceiver=null)
 Sends 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)
 
virtual bool PrepareAndValidateCommand< TCommand > (TCommand command, out RouteHandlerDelegate commandHandler)
 

Properties

static RouteManager Routes [get]
 
IAuthenticationTokenHelper< TAuthenticationToken > AuthenticationTokenHelper [get]
 
ICorrelationIdHelper CorrelationIdHelper [get]
 
IDependencyResolver DependencyResolver [get]
 
IBusHelper BusHelper [get]
 
ILogger Logger [get]
 
ICommandPublisher< TAuthenticationToken > CommandSender [get]
 
ICommandReceiver< TAuthenticationToken > CommandReceiver [get]
 
IDictionary< Guid, IList< IEvent< TAuthenticationToken > > > EventWaits [get]
 

Detailed Description

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