Table of Contents

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
Derived
Inherited Members

Constructors

RabbitMqCommandQueue(IMarshaller, RabbitMqCommandQueueOptions)

Initializes a new instance of the RabbitMqCommandQueue class.

public RabbitMqCommandQueue(IMarshaller marshaller, RabbitMqCommandQueueOptions options)

Parameters

marshaller IMarshaller

The marshaller used for serializing and deserializing messages.

options RabbitMqCommandQueueOptions

The options used to configure the RabbitMQ command queue.

Exceptions

ArgumentNullException

marshaller cannot be null -or- options cannot be null.

ArgumentException

options are 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

setup Action<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

messages IEnumerable<IMessage<ICommand>>

The messages to send.

setup Action<AsyncOptions>

The AsyncOptions which may be configured.

Returns

Task

A Task that represents the asynchronous operation.

See Also