Interface IMessageHandler<TMessage>
Application service for handling requests.
Inherited Members
System.IDisposable.Dispose()
Namespace: Kephas.Messaging
Assembly: Kephas.Messaging.dll
Syntax
[AppServiceContract(ContractType = typeof(IMessageHandler), AllowMultiple = true, MetadataAttributes = new Type[]{typeof(MessageHandlerAttribute)})]
public interface IMessageHandler<in TMessage> : IMessageHandler, IDisposable
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the message. |
Methods
| Improve this Doc View SourceProcessAsync(TMessage, IMessagingContext, CancellationToken)
Processes the provided message asynchronously and returns a response promise.
Declaration
Task<IMessage> ProcessAsync(TMessage message, IMessagingContext context, CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| TMessage | message | The message to be handled. |
| IMessagingContext | context | The processing context. |
| System.Threading.CancellationToken | token | The cancellation token. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<IMessage> | The response promise. |