Class RabbitMqCommandQueue
- Namespace
- Savvyio.Extensions.RabbitMQ.Commands
- Assembly
- Savvyio.Extensions.RabbitMQ.dll
Provides a default implementation of the RabbitMqMessage class for messages holding an ICommand implementation.
public class RabbitMqCommandQueue : RabbitMqMessage, IDisposable, IAsyncDisposable, IAsyncHealthCheckProvider<IConnection>, IPointToPointChannel<ICommand>, ISender<ICommand>, IReceiver<ICommand>
- Inheritance
-
RabbitMqCommandQueue
- Implements
-
IAsyncHealthCheckProvider<IConnection>
- Derived
- Inherited Members
Constructors
RabbitMqCommandQueue(IMarshaller, RabbitMqCommandQueueOptions)
Initializes a new instance of the RabbitMqCommandQueue class.
public RabbitMqCommandQueue(IMarshaller marshaller, RabbitMqCommandQueueOptions options)
Parameters
marshallerIMarshallerThe marshaller used for serializing and deserializing messages.
optionsRabbitMqCommandQueueOptionsThe options used to configure the RabbitMQ command queue.
Exceptions
- ArgumentNullException
marshallercannot be null -or-optionscannot be null.- ArgumentException
optionsare not in a valid state.
Methods
ReceiveAsync(Action<AsyncOptions>)
Receives command messages asynchronously from the configured RabbitMQ queue.
public IAsyncEnumerable<IMessage<ICommand>> ReceiveAsync(Action<AsyncOptions> setup = null)
Parameters
setupAction<AsyncOptions>The AsyncOptions which may be configured.
Returns
- IAsyncEnumerable<IMessage<ICommand>>
An IAsyncEnumerable<T> that yields IMessage<T> instances as they are received.
SendAsync(IEnumerable<IMessage<ICommand>>, Action<AsyncOptions>)
Sends the specified command messages asynchronously to the configured RabbitMQ queue.
public Task SendAsync(IEnumerable<IMessage<ICommand>> messages, Action<AsyncOptions> setup = null)
Parameters
messagesIEnumerable<IMessage<ICommand>>The messages to send.
setupAction<AsyncOptions>The AsyncOptions which may be configured.
Returns
See Also
IPointToPointChannel<TRequest>