Interface IMessageBus
Specifies a cloud of nodes that can communicate with each other through the network.
Namespace: DotNext.Net.Cluster.Messaging
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IMessageBus : ICluster
Properties
| Improve this Doc View SourceLeader
Gets the leader node.
Declaration
ISubscriber Leader { get; }
Property Value
| Type | Description |
|---|---|
| ISubscriber |
Members
Represents a collection of nodes in the network.
Declaration
IReadOnlyCollection<ISubscriber> Members { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<ISubscriber> |
Methods
| Improve this Doc View SourceSendMessageToLeaderAsync<TResponse>(IMessage, MessageReader<TResponse>, CancellationToken)
Sends a message to the cluster leader.
Declaration
Task<TResponse> SendMessageToLeaderAsync<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
message should be reusable because
SendSignalToLeaderAsync(IMessage, CancellationToken)
Sends one-way message to the cluster leader.
Declaration
Task SendSignalToLeaderAsync(IMessage message, CancellationToken token = null)
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. |
Remarks
message should be reusable because