Class AmazonCommandQueue
- Namespace
- Savvyio.Extensions.SimpleQueueService.Commands
- Assembly
- Savvyio.Extensions.SimpleQueueService.dll
Provides a default implementation of the AmazonQueue<TRequest> class tailored for messages holding an ICommand implementation.
public class AmazonCommandQueue : AmazonQueue<ICommand>, IConfigurable<AmazonMessageOptions>, IPointToPointChannel<ICommand>, ISender<ICommand>, IReceiver<ICommand>, IHealthCheckProvider<IAmazonSQS>
- Inheritance
-
AmazonCommandQueue
- Implements
- Derived
- Inherited Members
Constructors
AmazonCommandQueue(IMarshaller, AmazonCommandQueueOptions)
Initializes a new instance of the AmazonCommandQueue class.
public AmazonCommandQueue(IMarshaller marshaller, AmazonCommandQueueOptions options)
Parameters
marshallerIMarshallerThe IMarshaller that is used when converting ICommand implementations to messages.
optionsAmazonCommandQueueOptionsThe AmazonCommandQueueOptions used to configure this instance.
Exceptions
- ArgumentNullException
marshallercannot be null - or -optionscannot be null.- ArgumentException
optionsare not in a valid state.
Methods
GetHealthCheckTarget()
Returns a new IAmazonSQS client instance configured for health probing of the underlying Amazon SQS service.
public IAmazonSQS GetHealthCheckTarget()
Returns
- IAmazonSQS
An IAmazonSQS client instance used to probe the health status of the queue service.
ReceiveAsync(Action<AsyncOptions>)
Receive one or more command(s) asynchronous using Point-to-Point Channel/P2P MEP.
public override IAsyncEnumerable<IMessage<ICommand>> ReceiveAsync(Action<AsyncOptions> setup = null)
Parameters
setupAction<AsyncOptions>The AsyncOptions which may be configured.
Returns
- IAsyncEnumerable<IMessage<ICommand>>
A task that represents the asynchronous operation. The task result contains a sequence of IMessage<T> whose generic type argument is ICommand.
SendAsync(IEnumerable<IMessage<ICommand>>, Action<AsyncOptions>)
Sends the specified messages whose generic type argument is ICommand asynchronous using Point-to-Point Channel/P2P MEP.
public override Task SendAsync(IEnumerable<IMessage<ICommand>> messages, Action<AsyncOptions> setup = null)
Parameters
messagesIEnumerable<IMessage<ICommand>>The ICommand enclosed messages to send.
setupAction<AsyncOptions>The AsyncOptions which may be configured.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
messagescannot be null.