Table of Contents

Class ClusterState

Namespace
Yarp.ReverseProxy.Model
Assembly
Yarp.ReverseProxy.dll

Representation of a cluster for use at runtime.

public sealed class ClusterState
Inheritance
ClusterState
Inherited Members

Constructors

ClusterState(string)

Creates a new instance. This constructor is for tests and infrastructure, this type is normally constructed by the configuration loading infrastructure.

public ClusterState(string clusterId)

Parameters

clusterId string

ClusterState(string, ClusterModel)

Constructor overload to additionally initialize the ClusterModel for tests and infrastructure, such as updating the ReverseProxyFeature via HttpContextFeaturesExtensions

public ClusterState(string clusterId, ClusterModel model)

Parameters

clusterId string
model ClusterModel

Exceptions

ArgumentNullException

model is null.

Properties

ClusterId

The cluster's unique id.

public string ClusterId { get; }

Property Value

string

Destinations

All of the destinations associated with this cluster. This collection is populated by the configuration system and should only be directly modified in a test environment. Call IClusterDestinationsUpdater after modifying this collection.

public ConcurrentDictionary<string, DestinationState> Destinations { get; }

Property Value

ConcurrentDictionary<string, DestinationState>

DestinationsState

Stores the state of cluster's destinations that can change atomically in reaction to runtime state changes (e.g. changes of destinations' health).

public ClusterDestinationsState DestinationsState { get; set; }

Property Value

ClusterDestinationsState

Model

Encapsulates parts of a cluster that can change atomically in reaction to config changes.

public ClusterModel Model { get; }

Property Value

ClusterModel