Show / Hide Table of Contents

Interface IClusterMember

Represents cluster member.

Inherited Members
IPeer.EndPoint
Namespace: DotNext.Net.Cluster
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IClusterMember : IPeer

Properties

| Edit this page View Source

Id

Gets unique identifier of this member.

Declaration
ClusterMemberId Id { get; }
Property Value
Type Description
ClusterMemberId
| Edit this page View Source

IsLeader

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

Declaration
bool IsLeader { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsRemote

Indicates that this instance represents remote or local cluster member.

Declaration
bool IsRemote { get; }
Property Value
Type Description
bool
| Edit this page View Source

Status

Gets status of this member.

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

Methods

| Edit this page View Source

GetMetadataAsync(bool, CancellationToken)

Obtains metadata associated with this member.

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

| Edit this page View Source

OnMemberStatusChanged<TMember>(TMember, ref ClusterMemberStatus, ClusterMemberStatus, InvocationList<Action<ClusterMemberStatusChangedEventArgs<TMember>>>)

Helper method for raising MemberStatusChanged event.

Declaration
protected static void OnMemberStatusChanged<TMember>(TMember member, ref ClusterMemberStatus status, ClusterMemberStatus newState, InvocationList<Action<ClusterMemberStatusChangedEventArgs<TMember>>> memberStatusChanged) where TMember : class, IClusterMember
Parameters
Type Name Description
TMember member

The current member.

ClusterMemberStatus status

The member status holder.

ClusterMemberStatus newState

A new state of the member.

InvocationList<Action<ClusterMemberStatusChangedEventArgs<TMember>>> memberStatusChanged

A collection of event handlers.

Type Parameters
Name Description
TMember

The type of the cluster member.

| Edit this page 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<bool>

true, if leadership is revoked successfully; otherwise, false.

Exceptions
Type Condition
MemberUnavailableException

This member is not reachable through the network.

Events

| Edit this page View Source

MemberStatusChanged

An event raised when cluster member becomes available or unavailable.

Declaration
event Action<ClusterMemberStatusChangedEventArgs> MemberStatusChanged
Event Type
Type Description
Action<ClusterMemberStatusChangedEventArgs>

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾