Interface IMessageChannelSender<TMessage>
Defines the send-side contract for a message channel.
public interface IMessageChannelSender<TMessage> where TMessage : class
Type Parameters
TMessageThe type of message handled by the channel.
- Extension Methods
Methods
SendAsync(TMessage, CancellationToken)
Sends a message through the channel.
Task SendAsync(TMessage message, CancellationToken cancellationToken)
Parameters
messageTMessageThe message to send.
cancellationTokenCancellationTokenA cancellation token to cancel the operation.
Returns
- Task
A task that represents the asynchronous send operation.
SendBatchAsync(IEnumerable<TMessage>, CancellationToken)
Sends a batch of messages through the channel.
Task SendBatchAsync(IEnumerable<TMessage> messages, CancellationToken cancellationToken)
Parameters
messagesIEnumerable<TMessage>The messages to send.
cancellationTokenCancellationTokenA cancellation token to cancel the operation.
Returns
- Task
A task that represents the asynchronous batch send operation.