Class AzureCommandBusPublisher<TAuthenticationToken>
A ICommandPublisher<TAuthenticationToken> that resolves handlers , executes the handler and then publishes the ICommand<TAuthenticationToken> on the private command bus.
Inheritance
Inherited Members
Namespace: Cqrs.Azure.ServiceBus
Assembly: Cqrs.Azure.ServiceBus.dll
Syntax
public class AzureCommandBusPublisher<TAuthenticationToken> : AzureCommandBus<TAuthenticationToken>, IPublishAndWaitCommandPublisher<TAuthenticationToken>, ICommandPublisher<TAuthenticationToken>
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The |
Constructors
AzureCommandBusPublisher(IConfigurationManager, IMessageSerialiser<TAuthenticationToken>, IAuthenticationTokenHelper<TAuthenticationToken>, ICorrelationIdHelper, ILogger, IAzureBusHelper<TAuthenticationToken>, IBusHelper)
Instantiates a new instance of AzureCommandBusPublisher<TAuthenticationToken>.
Declaration
public AzureCommandBusPublisher(IConfigurationManager configurationManager, IMessageSerialiser<TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper<TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IAzureBusHelper<TAuthenticationToken> azureBusHelper, IBusHelper busHelper)
Parameters
Type | Name | Description |
---|---|---|
IConfigurationManager | configurationManager | |
IMessageSerialiser<TAuthenticationToken> | messageSerialiser | |
IAuthenticationTokenHelper<TAuthenticationToken> | authenticationTokenHelper | |
ICorrelationIdHelper | correlationIdHelper | |
ILogger | logger | |
IAzureBusHelper<TAuthenticationToken> | azureBusHelper | |
IBusHelper | busHelper |
Methods
Publish<TCommand>(TCommand)
Publishes the provided command
on the command bus.
Declaration
public virtual void Publish<TCommand>(TCommand command)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TCommand | command |
Type Parameters
Name | Description |
---|---|
TCommand |
Implements
Publish<TCommand>(IEnumerable<TCommand>)
Publishes the provided commands
on the command bus.
Declaration
public virtual void Publish<TCommand>(IEnumerable<TCommand> commands)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<TCommand> | commands |
Type Parameters
Name | Description |
---|---|
TCommand |
PublishAndWait<TCommand, TEvent>(TCommand, IEventReceiver<TAuthenticationToken>)
Publishes the provided command
and waits for an event of TEvent
Declaration
public virtual TEvent PublishAndWait<TCommand, TEvent>(TCommand command, IEventReceiver<TAuthenticationToken> eventReceiver = null)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The |
IEventReceiver<TAuthenticationToken> | eventReceiver | If provided, is the IEventReceiver<TAuthenticationToken> that the event is expected to be returned on. |
Returns
Type | Description |
---|---|
TEvent |
Type Parameters
Name | Description |
---|---|
TCommand | |
TEvent |
Implements
PublishAndWait<TCommand, TEvent>(TCommand, Func<IEnumerable<IEvent<TAuthenticationToken>>, TEvent>, IEventReceiver<TAuthenticationToken>)
Publishes the provided command
and waits until the specified condition is satisfied an event of TEvent
Declaration
public virtual TEvent PublishAndWait<TCommand, TEvent>(TCommand command, Func<IEnumerable<IEvent<TAuthenticationToken>>, TEvent> condition, IEventReceiver<TAuthenticationToken> eventReceiver = null)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The |
Func<IEnumerable<IEvent<TAuthenticationToken>>, TEvent> | condition | A delegate to be executed over and over until it returns the |
IEventReceiver<TAuthenticationToken> | eventReceiver | If provided, is the IEventReceiver<TAuthenticationToken> that the event is expected to be returned on. |
Returns
Type | Description |
---|---|
TEvent |
Type Parameters
Name | Description |
---|---|
TCommand | |
TEvent |
PublishAndWait<TCommand, TEvent>(TCommand, Func<IEnumerable<IEvent<TAuthenticationToken>>, TEvent>, Int32, IEventReceiver<TAuthenticationToken>)
Publishes the provided command
and waits for an event of TEvent
or exits if the specified timeout is expired.
Declaration
public virtual TEvent PublishAndWait<TCommand, TEvent>(TCommand command, Func<IEnumerable<IEvent<TAuthenticationToken>>, TEvent> condition, int millisecondsTimeout, IEventReceiver<TAuthenticationToken> eventReceiver = null)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The |
Func<IEnumerable<IEvent<TAuthenticationToken>>, TEvent> | condition | A delegate to be executed over and over until it returns the |
System.Int32 | millisecondsTimeout | The number of milliseconds to wait, or System.Threading.Timeout.Infinite (-1) to wait indefinitely. |
IEventReceiver<TAuthenticationToken> | eventReceiver | If provided, is the IEventReceiver<TAuthenticationToken> that the event is expected to be returned on. |
Returns
Type | Description |
---|---|
TEvent |
Type Parameters
Name | Description |
---|---|
TCommand | |
TEvent |
PublishAndWait<TCommand, TEvent>(TCommand, Func<IEnumerable<IEvent<TAuthenticationToken>>, TEvent>, TimeSpan, IEventReceiver<TAuthenticationToken>)
Publishes the provided command
and waits for an event of TEvent
or exits if the specified timeout is expired.
Declaration
public virtual TEvent PublishAndWait<TCommand, TEvent>(TCommand command, Func<IEnumerable<IEvent<TAuthenticationToken>>, TEvent> condition, TimeSpan timeout, IEventReceiver<TAuthenticationToken> eventReceiver = null)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The |
Func<IEnumerable<IEvent<TAuthenticationToken>>, TEvent> | condition | A delegate to be executed over and over until it returns the |
TimeSpan | timeout | A System.TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely. |
IEventReceiver<TAuthenticationToken> | eventReceiver | If provided, is the IEventReceiver<TAuthenticationToken> that the event is expected to be returned on. |
Returns
Type | Description |
---|---|
TEvent |
Type Parameters
Name | Description |
---|---|
TCommand | |
TEvent |
PublishAndWait<TCommand, TEvent>(TCommand, Int32, IEventReceiver<TAuthenticationToken>)
Publishes the provided command
and waits for an event of TEvent
or exits if the specified timeout is expired.
Declaration
public virtual TEvent PublishAndWait<TCommand, TEvent>(TCommand command, int millisecondsTimeout, IEventReceiver<TAuthenticationToken> eventReceiver = null)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The |
System.Int32 | millisecondsTimeout | The number of milliseconds to wait, or System.Threading.Timeout.Infinite (-1) to wait indefinitely. |
IEventReceiver<TAuthenticationToken> | eventReceiver | If provided, is the IEventReceiver<TAuthenticationToken> that the event is expected to be returned on. |
Returns
Type | Description |
---|---|
TEvent |
Type Parameters
Name | Description |
---|---|
TCommand | |
TEvent |
Implements
PublishAndWait<TCommand, TEvent>(TCommand, TimeSpan, IEventReceiver<TAuthenticationToken>)
Publishes the provided command
and waits for an event of TEvent
or exits if the specified timeout is expired.
Declaration
public virtual TEvent PublishAndWait<TCommand, TEvent>(TCommand command, TimeSpan timeout, IEventReceiver<TAuthenticationToken> eventReceiver = null)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The |
TimeSpan | timeout | A System.TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely. |
IEventReceiver<TAuthenticationToken> | eventReceiver | If provided, is the IEventReceiver<TAuthenticationToken> that the event is expected to be returned on. |
Returns
Type | Description |
---|---|
TEvent |
Type Parameters
Name | Description |
---|---|
TCommand | |
TEvent |