Interface IMessageHandler<TMessage>
Defines a handler for a specific message type. The bus infrastructure will invoke this when a matching message arrives.
Namespace: Chapar.Core.Abstractions
Assembly: Chapar.Core.dll
Syntax
public interface IMessageHandler<in TMessage> where TMessage : class, IMessage
Type Parameters
| Name | Description |
|---|---|
| TMessage | The message type (can be an event, a command, etc.). |
Methods
| Edit this page View SourceHandleAsync(TMessage, CancellationToken)
Handles the incoming message. If this method throws, the bus will apply its configured retry / error policies.
Declaration
Task HandleAsync(TMessage message, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TMessage | message | The received message. |
| CancellationToken | cancellationToken | Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task |