Interface IClusterMember
Represents cluster member.
Namespace: DotNext.Net.Cluster
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IClusterMember : IEquatable<IClusterMember>
Properties
| Improve this Doc View SourceEndpoint
Represents cluster member endpoint that can be used to send messages specific to consensus protocol.
Declaration
IPEndPoint Endpoint { get; }
Property Value
| Type | Description |
|---|---|
| IPEndPoint |
IsLeader
Indicates that executing host is a leader node in the cluster.
Declaration
bool IsLeader { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
IsRemote
Indicates that this instance represents remote or local cluster member.
Declaration
bool IsRemote { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Status
Gets status of this member.
Declaration
ClusterMemberStatus Status { get; }
Property Value
| Type | Description |
|---|---|
| ClusterMemberStatus |
Methods
| Improve this Doc View SourceGetMetadata(Boolean, CancellationToken)
Obtains metadata associated with this member.
Declaration
ValueTask<IReadOnlyDictionary<string, string>> GetMetadata(bool refresh = false, CancellationToken token = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | refresh | true to make a network request to the member and update local cache; false to obtain cached metadata. |
| CancellationToken | token | The token that can be used to cancel operation. |
Returns
| Type | Description |
|---|---|
| ValueTask<IReadOnlyDictionary<String, String>> | The task representing metadata read operation. |
Remarks
This method is completed synchronously is most cases if refresh is false.
Exceptions
| Type | Condition |
|---|---|
| MemberUnavailableException | This member is not reachable through the network. |
ResignAsync(CancellationToken)
Revokes leadership.
Declaration
Task<bool> ResignAsync(CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | token | The token that can be used to cancel asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<Boolean> | true, if leadership is revoked successfully; otherwise, false. |
Exceptions
| Type | Condition |
|---|---|
| MemberUnavailableException | This member is not reachable through the network. |
Events
| Improve this Doc View SourceMemberStatusChanged
An event raised when cluster member becomes available or unavailable.
Declaration
event ClusterMemberStatusChanged MemberStatusChanged
Event Type
| Type | Description |
|---|---|
| ClusterMemberStatusChanged |