Interface IOutputChannel
Defines the interface that a channel must implement to send a message.
Namespace: DotNext.Net.Cluster.Messaging
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IOutputChannel
Methods
| Edit this page View SourceSendMessageAsync<TResponse>(IMessage, MessageReader<TResponse>, CancellationToken)
Sends a request message.
Declaration
Task<TResponse> SendMessageAsync<TResponse>(IMessage message, MessageReader<TResponse> responseReader, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
IMessage | message | The message to be sent. |
MessageReader<TResponse> | responseReader | The response reader. |
CancellationToken | token | The token that can be used to cancel asynchronous operation. |
Returns
Type | Description |
---|---|
Task<TResponse> | The message representing response; or null if request message in one-way. |
Type Parameters
Name | Description |
---|---|
TResponse | The type of the parsed response message. |
Remarks
The message content may be available inside of responseReader
only.
Do not try to return response message itself from the delegate.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Attempts to send message to local or unavailable endpoint. |
OperationCanceledException | The operation has been canceled. |
SendMessageAsync<TResponse>(IMessage, CancellationToken)
Sends a request message.
Declaration
Task<TResponse> SendMessageAsync<TResponse>(IMessage message, CancellationToken token = default) where TResponse : notnull, ISerializable<TResponse>
Parameters
Type | Name | Description |
---|---|---|
IMessage | message | The message to be sent. |
CancellationToken | token | The token that can be used to cancel asynchronous operation. |
Returns
Type | Description |
---|---|
Task<TResponse> | The message representing response; or null if request message in one-way. |
Type Parameters
Name | Description |
---|---|
TResponse | The type of the parsed response message. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Attempts to send message to local or unavailable endpoint. |
OperationCanceledException | The operation has been canceled. |
SendSignalAsync(IMessage, CancellationToken)
Sends one-way message.
Declaration
Task SendSignalAsync(IMessage message, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
IMessage | message | The message to be sent. |
CancellationToken | token | The token that can be used to cancel asynchronous operation. |
Returns
Type | Description |
---|---|
Task | The task representing execution of this method. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Attempts to send message to local or unavailable endpoint. |
OperationCanceledException | The operation has been canceled. |