Show / Hide Table of Contents

Interface IClusterMember

Represents cluster member.

Namespace: DotNext.Net.Cluster
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IClusterMember

Properties

| Improve this Doc View Source

Endpoint

Represents cluster member endpoint that can be used to send messages specific to consensus protocol.

Declaration
IPEndPoint Endpoint { get; }
Property Value
Type Description
IPEndPoint
| Improve this Doc View Source

Id

Gets unique identifier of this member.

Declaration
virtual ClusterMemberId Id { get; }
Property Value
Type Description
ClusterMemberId
| Improve this Doc View Source

IsLeader

Indicates that executing host is a leader node in the cluster.

Declaration
bool IsLeader { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsRemote

Indicates that this instance represents remote or local cluster member.

Declaration
bool IsRemote { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Status

Gets status of this member.

Declaration
ClusterMemberStatus Status { get; }
Property Value
Type Description
ClusterMemberStatus

Methods

| Improve this Doc View Source

GetMetadataAsync(Boolean, CancellationToken)

Obtains metadata associated with this member.

Declaration
ValueTask<IReadOnlyDictionary<string, string>> GetMetadataAsync(bool refresh = false, CancellationToken token = default(CancellationToken))
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.

| Improve this Doc View Source

OnMemberStatusChanged(IClusterMember, ref AtomicEnum<ClusterMemberStatus>, ClusterMemberStatus, ClusterMemberStatusChanged)

Helper method for raising MemberStatusChanged event.

Declaration
static void OnMemberStatusChanged(IClusterMember member, ref AtomicEnum<ClusterMemberStatus> status, ClusterMemberStatus newState, ClusterMemberStatusChanged memberStatusChanged)
Parameters
Type Name Description
IClusterMember member

The current member.

AtomicEnum<ClusterMemberStatus> status

The member status holder.

ClusterMemberStatus newState

A new state of the member.

ClusterMemberStatusChanged memberStatusChanged

A collection of event handlers.

| Improve this Doc View Source

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 Source

MemberStatusChanged

An event raised when cluster member becomes available or unavailable.

Declaration
event ClusterMemberStatusChanged MemberStatusChanged
Event Type
Type Description
ClusterMemberStatusChanged

Extension Methods

AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireUpgradeableReadLockAsync<T>(T, CancellationToken)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>, out TResult1, out TResult2)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, Func<T, TResult1>, Func<T, TResult2>)
ObjectExtensions.Decompose<T, TResult1, TResult2>(T, ValueFunc<T, TResult1>, ValueFunc<T, TResult2>)
ObjectExtensions.As<T>(T)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX