Class AzureCommandQueue<TMarker>
- Assembly
- Savvyio.Extensions.DependencyInjection.QueueStorage.dll
Provides a default implementation of the AzureCommandQueue class that is optimized for Dependency Injection.
public class AzureCommandQueue<TMarker> : AzureCommandQueue, IHealthCheckProvider<QueueServiceClient>, IPointToPointChannel<ICommand, TMarker>, IPointToPointChannel<ICommand>, ISender<ICommand, TMarker>, ISender<ICommand>, IReceiver<ICommand, TMarker>, IReceiver<ICommand>, IDependencyInjectionMarker<TMarker>
Type Parameters
TMarker
- Inheritance
-
AzureCommandQueue<TMarker>
- Implements
-
IPointToPointChannel<ICommand, TMarker>IDependencyInjectionMarker<TMarker>
- Inherited Members
Examples
AzureCommandQueue<TMarker> is the DI-registered Azure Queue Storage command queue with a lifetime marker. It implements both ISender<ICommand> and IReceiver<ICommand>. Inject it directly or through one of those interfaces to send and receive commands via Azure Storage queues.
using Savvyio.Commands;
using Savvyio.Extensions.QueueStorage.Commands;
using Savvyio.Messaging;
namespace ExampleApp;
public sealed class AzureCommandService
{
private readonly ISender<ICommand> _sender;
private readonly IReceiver<ICommand> _receiver;
public AzureCommandService(AzureCommandQueue queue)
{
_sender = queue;
_receiver = queue;
}
public ISender<ICommand> Sender => _sender;
public IReceiver<ICommand> Receiver => _receiver;
}
Constructors
AzureCommandQueue(IMarshaller, AzureQueueOptions<TMarker>)
Initializes a new instance of the AzureCommandQueue<TMarker> class.
public AzureCommandQueue(IMarshaller marshaller, AzureQueueOptions<TMarker> options)
Parameters
marshallerIMarshallerThe IMarshaller that is used when converting ICommand implementations to messages.
optionsAzureQueueOptions<TMarker>The AzureQueueOptions<TMarker> used to configure this instance.
Exceptions
- ArgumentNullException
marshallercannot be null - or -optionscannot be null.- ArgumentException
optionsare not in a valid state.
See Also
IPointToPointChannel<TRequest, TMarker>