Class AmazonQueue<TRequest>
- Namespace
- Savvyio.Extensions.SimpleQueueService
- Assembly
- Savvyio.Extensions.SimpleQueueService.dll
Represents the base class from which all implementations in need of queue capabilities should derive.
public abstract class AmazonQueue<TRequest> : AmazonMessage<TRequest>, IConfigurable<AmazonMessageOptions>, IPointToPointChannel<TRequest>, ISender<TRequest>, IReceiver<TRequest> where TRequest : IRequest
Type Parameters
TRequestThe type of the model to handle.
- Inheritance
-
AmazonMessage<TRequest>AmazonQueue<TRequest>
- Implements
-
IPointToPointChannel<TRequest>ISender<TRequest>IReceiver<TRequest>
- Derived
- Inherited Members
Constructors
AmazonQueue(IMarshaller, AmazonMessageOptions)
Initializes a new instance of the AmazonQueue<TRequest> class.
protected AmazonQueue(IMarshaller marshaller, AmazonMessageOptions options)
Parameters
marshallerIMarshallerThe IMarshaller that is used when converting models to messages.
optionsAmazonMessageOptionsThe configured AmazonMessageOptions.
Exceptions
- ArgumentNullException
marshallercannot be null -or-optionscannot be null.- ArgumentException
optionsare not in a valid state.
Methods
ReceiveAsync(Action<AsyncOptions>)
Receive one or more message(s) asynchronous using Point-to-Point Channel/P2P MEP.
public abstract IAsyncEnumerable<IMessage<TRequest>> ReceiveAsync(Action<AsyncOptions> setup = null)
Parameters
setupAction<AsyncOptions>The AsyncOptions which may be configured.
Returns
- IAsyncEnumerable<IMessage<TRequest>>
A task that represents the asynchronous operation. The task result contains a sequence of IMessage<T> whose generic type argument is IRequest.
SendAsync(IEnumerable<IMessage<TRequest>>, Action<AsyncOptions>)
Sends the specified messages asynchronous using Point-to-Point Channel/P2P MEP.
public abstract Task SendAsync(IEnumerable<IMessage<TRequest>> messages, Action<AsyncOptions> setup = null)
Parameters
messagesIEnumerable<IMessage<TRequest>>The messages to send.
setupAction<AsyncOptions>The AsyncOptions which may be configured.
Returns
- Task
A task that represents the asynchronous operation.