Table of Contents

Interface IMessageSender<TBody>

Namespace
NuvTools.Notification.Messaging.Interfaces
Assembly
NuvTools.Notification.Messaging.dll

Represents an asynchronous sender capable of delivering messages whose bodies are of type TBody. Implementations perform the transport-specific work to transmit a Message<T>.

public interface IMessageSender<TBody> where TBody : class

Type Parameters

TBody

The message body type. Must be a reference type.

Methods

SendAsync(Message<TBody>, CancellationToken)

Sends the specified message asynchronously.

Task SendAsync(Message<TBody> message, CancellationToken cancellationToken)

Parameters

message Message<TBody>

The message to send. Implementations SHOULD validate that message is not null.

cancellationToken CancellationToken

A token to observe while waiting for the operation to complete.

Returns

Task

A Task that represents the asynchronous send operation.

Exceptions

ArgumentNullException

May be thrown by implementations if message is null.

OperationCanceledException

May be thrown if the cancellationToken is canceled before the operation completes.