Table of Contents

Class AmazonBus<TRequest>

Namespace
Savvyio.Extensions.SimpleQueueService
Assembly
Savvyio.Extensions.SimpleQueueService.dll

Represents the base class from which all implementations in need of bus capabilities should derive.

public abstract class AmazonBus<TRequest> : AmazonMessage<TRequest>, IConfigurable<AmazonMessageOptions>, IPublishSubscribeChannel<TRequest>, IPublisher<TRequest>, ISubscriber<TRequest> where TRequest : IRequest

Type Parameters

TRequest

The type of the model to handle.

Inheritance
AmazonMessage<TRequest>
AmazonBus<TRequest>
Implements
IPublisher<TRequest>
ISubscriber<TRequest>
Derived
Inherited Members

Constructors

AmazonBus(IMarshaller, AmazonMessageOptions)

Initializes a new instance of the AmazonBus<TRequest> class.

protected AmazonBus(IMarshaller marshaller, AmazonMessageOptions options)

Parameters

marshaller IMarshaller

The IMarshaller that is used when converting models to messages.

options AmazonMessageOptions

The AmazonMessageOptions used to configure this instance.

Exceptions

ArgumentNullException

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

ArgumentException

options are not in a valid state.

Methods

PublishAsync(IMessage<TRequest>, Action<AsyncOptions>)

Publishes the specified message asynchronous using Publish-Subscribe Channel/Pub-Sub MEP.

public abstract Task PublishAsync(IMessage<TRequest> message, Action<AsyncOptions> setup = null)

Parameters

message IMessage<TRequest>

The message to publish.

setup Action<AsyncOptions>

The AsyncOptions which may be configured.

Returns

Task

A Task that represents the asynchronous operation.

SubscribeAsync(Func<IMessage<TRequest>, CancellationToken, Task>, Action<SubscribeAsyncOptions>)

Subscribe to one or more message(s) asynchronous using Publish-Subscribe Channel/Pub-Sub MEP.

public abstract Task SubscribeAsync(Func<IMessage<TRequest>, CancellationToken, Task> asyncHandler, Action<SubscribeAsyncOptions> setup = null)

Parameters

asyncHandler Func<IMessage<TRequest>, CancellationToken, Task>

The function delegate that will handle the message.

setup Action<SubscribeAsyncOptions>

The SubscribeAsyncOptions which may be configured.

Returns

Task

A Task that represents the asynchronous operation.

See Also