Interface IMessageHandler
Represents incoming message handler that can be registered in DI container.
Namespace: DotNext.Net.Cluster.Messaging
Assembly: DotNext.AspNetCore.Cluster.dll
Syntax
public interface IMessageHandler
Methods
| Improve this Doc View SourceReceiveMessage(ISubscriber, IMessage, Object)
Handles incoming message from the specified cluster member.
Declaration
Task<IMessage> ReceiveMessage(ISubscriber sender, IMessage message, object context)
Parameters
Type | Name | Description |
---|---|---|
ISubscriber | sender | The sender of the message. |
IMessage | message | The received message. |
Object | context | The context of the underlying network request. |
Returns
Type | Description |
---|---|
Task<IMessage> | The response message. |
Remarks
Implementation of this method should handle every exception inside of it and prepare response message representing such exception.
ReceiveSignal(ISubscriber, IMessage, Object)
Handles incoming signal from the specified cluster member.
Declaration
Task ReceiveSignal(ISubscriber sender, IMessage signal, object context)
Parameters
Type | Name | Description |
---|---|---|
ISubscriber | sender | The sender of the message. |
IMessage | signal | The received message representing signal. |
Object | context | The context of the underlying network request. |
Returns
Type | Description |
---|---|
Task | The task representing asynchronous execution of the method. |