Class MessageHandlerBase<TMessage, TResponse>
Provides a base implementation of a message handler.
Inheritance
Inherited Members
Namespace: Kephas.Messaging
Assembly: Kephas.Messaging.dll
Syntax
public abstract class MessageHandlerBase<TMessage, TResponse> : Loggable, ILoggable, IMessageHandler<TMessage>, IMessageHandler, IDisposable where TMessage : class where TResponse : class
Type Parameters
Name | Description |
---|---|
TMessage | The message type. |
TResponse | The response type. |
Methods
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
|
ProcessAsync(TMessage, IMessagingContext, CancellationToken)
Processes the provided message asynchronously and returns a response promise.
Declaration
public abstract Task<TResponse> 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<TResponse> | The response promise. |
Explicit Interface Implementations
| Improve this Doc View SourceIMessageHandler.ProcessAsync(IMessage, IMessagingContext, CancellationToken)
Processes the provided message asynchronously and returns a response promise.
Declaration
Task<IMessage> IMessageHandler.ProcessAsync(IMessage message, IMessagingContext context, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
IMessage | 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. |
IMessageHandler<TMessage>.ProcessAsync(TMessage, IMessagingContext, CancellationToken)
Processes the provided message asynchronously and returns a response promise.
Declaration
Task<IMessage> IMessageHandler<TMessage>.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. |