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
TBodyThe 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
messageMessage<TBody>The message to send. Implementations SHOULD validate that
messageis notnull.cancellationTokenCancellationTokenA token to observe while waiting for the operation to complete.
Returns
Exceptions
- ArgumentNullException
May be thrown by implementations if
messageisnull.- OperationCanceledException
May be thrown if the
cancellationTokenis canceled before the operation completes.