Interface ISubscriber
Represents cluster member that supports messaging.
Inherited Members
Namespace: DotNext.Net.Cluster.Messaging
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface ISubscriber : IClusterMember, IEquatable<IClusterMember>
Methods
| Improve this Doc View SourceSendMessageAsync<TResponse>(IMessage, MessageReader<TResponse>, CancellationToken)
Sends a message to the cluster member.
Declaration
Task<TResponse> SendMessageAsync<TResponse>(IMessage message, MessageReader<TResponse> responseReader, CancellationToken token = null)
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 IMessage itself from the delegate.
SendSignalAsync(IMessage, Boolean, CancellationToken)
Sends one-way message to the cluster member.
Declaration
Task SendSignalAsync(IMessage message, bool requiresConfirmation = true, CancellationToken token = null)
Parameters
Type | Name | Description |
---|---|---|
IMessage | message | The message to be sent. |
Boolean | requiresConfirmation | true to wait for confirmation of delivery from receiver; otherwise, false. |
CancellationToken | token | The token that can be used to cancel asynchronous operation. |
Returns
Type | Description |
---|---|
Task | The task representing execution of this method. |