Show / Hide Table of Contents

Interface ICluster

Represents local view of the entire cluster.

Inherited Members
IPeerMesh<IClusterMember>.TryGetPeer(EndPoint)
IPeerMesh.Peers
IPeerMesh.PeerDiscovered
IPeerMesh.PeerGone
Namespace: DotNext.Net.Cluster
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface ICluster : IPeerMesh<IClusterMember>, IPeerMesh

Properties

| Edit this page View Source

Leader

Gets the leader node.

Declaration
IClusterMember? Leader { get; }
Property Value
Type Description
IClusterMember

Methods

| Edit this page View Source

ResignAsync(CancellationToken)

Revokes leadership and starts new election process.

Declaration
ValueTask<bool> ResignAsync(CancellationToken token = default)
Parameters
Type Name Description
CancellationToken token
Returns
Type Description
ValueTask<bool>

true if leadership is revoked successfully; otherwise, false.

| Edit this page View Source

WaitForLeaderAsync(TimeSpan, CancellationToken)

Waits for the leader election asynchronously.

Declaration
ValueTask<IClusterMember> WaitForLeaderAsync(TimeSpan timeout, CancellationToken token = default)
Parameters
Type Name Description
TimeSpan timeout

The time to wait; or InfiniteTimeSpan.

CancellationToken token

The token that can be used to cancel the operation.

Returns
Type Description
ValueTask<IClusterMember>

The elected leader.

Exceptions
Type Condition
TimeoutException

The operation is timed out.

OperationCanceledException

The operation has been canceled.

ObjectDisposedException

The local node is disposed.

Events

| Edit this page View Source

LeaderChanged

An event raised when leader has been changed.

Declaration
event Action<ICluster, IClusterMember?> LeaderChanged
Event Type
Type Description
Action<ICluster, IClusterMember>

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
☀
☾