Interface IInputChannel
Defines the interface that a channel must implement to receive a message.
Namespace: DotNext.Net.Cluster.Messaging
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IInputChannel
Methods
| Edit this page View SourceIsSupported(string, bool)
Determines whether the specified message can be processed by this handler.
Declaration
bool IsSupported(string messageName, bool oneWay)
Parameters
Type | Name | Description |
---|---|---|
string | messageName | The name of the message. |
bool | oneWay | true if message is one-way; false if message is request message that requires a response. |
Returns
Type | Description |
---|---|
bool | true if message can be processed by this handler; otherwise, false. |
ReceiveMessage(ISubscriber, IMessage, object?, CancellationToken)
Handles incoming message from the specified cluster member.
Declaration
Task<IMessage> ReceiveMessage(ISubscriber sender, IMessage message, object? context, CancellationToken token)
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. |
CancellationToken | token | The token that can be used to cancel the operation. |
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?, CancellationToken)
Handles incoming signal from the specified cluster member.
Declaration
Task ReceiveSignal(ISubscriber sender, IMessage signal, object? context, CancellationToken token)
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. |
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
Task | The task representing asynchronous execution of the method. |