Interface IPublishAndWaitCommandPublisher<TAuthenticationToken>
Publishes an ICommand<TAuthenticationToken>
Inherited Members
Namespace: Cqrs.Commands
Assembly: Cqrs.dll
Syntax
public interface IPublishAndWaitCommandPublisher<TAuthenticationToken> : ICommandPublisher<TAuthenticationToken>
Type Parameters
Name | Description |
---|---|
TAuthenticationToken | The System.Type of the authentication token. |
Methods
PublishAndWait<TCommand, TEvent>(TCommand, IEventReceiver<TAuthenticationToken>)
Publishes the provided command
and waits for an event of TEvent
Declaration
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 |
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
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 |
System.Func<System.Collections.Generic.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
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 |
System.Func<System.Collections.Generic.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
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 |
System.Func<System.Collections.Generic.IEnumerable<IEvent<TAuthenticationToken>>, TEvent> | condition | A delegate to be executed over and over until it returns the |
System.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
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 |
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
TEvent PublishAndWait<TCommand, TEvent>(TCommand command, TimeSpan timeout, IEventReceiver<TAuthenticationToken> eventReceiver = null)where TCommand : ICommand<TAuthenticationToken>
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | The |
System.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 |