Class ClusterManager
Thread-safe cluster manager. Snapshot swaps use compare-and-swap;
in-flight sessions keep the previous snapshot reference.
Inheritance
ClusterManager
Implements
IClusterManager
IDestinationHealthEvents
Assembly: Titanium.Web.Proxy.dll
Syntax
public sealed class ClusterManager : IClusterManager, IDestinationHealthEvents, IAsyncDisposable
Constructors
|
Edit this page
View Source
ClusterManager()
Declaration
Properties
|
Edit this page
View Source
ActiveHealthProbeProvider
Active probes for healthCheck.active. When this is null, healthCheck.active stays inactive:
core refreshes DNS and leaves destination health to passive checks and other callers.
Assigning a provider reconciles the clusters already applied and starts a probe for each one whose
active check is enabled. Titanium Plus assigns a provider when the Plus module loads.
Declaration
public IActiveHealthProbeProvider? ActiveHealthProbeProvider { get; set; }
Property Value
| Type |
Description |
| IActiveHealthProbeProvider |
|
|
Edit this page
View Source
LocalZone
Data-plane availability zone for zone-aware clusters. Empty disables zone filtering.
Declaration
public string? LocalZone { get; set; }
Property Value
|
Edit this page
View Source
Snapshot
Declaration
public ImmutableClusterSnapshot Snapshot { get; }
Property Value
| Type |
Description |
| ImmutableClusterSnapshot |
|
Methods
|
Edit this page
View Source
ApplyAsync(IReadOnlyList<ClusterConfig>, CancellationToken)
Declaration
public ValueTask ApplyAsync(IReadOnlyList<ClusterConfig> clusters, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
ApplyCoreAsync(IReadOnlyList<ClusterConfig>, bool, CancellationToken)
reconcileBackground is false for the temporary old-union-new apply during reload,
so probers start or stop only on the final apply.
Declaration
public ValueTask ApplyCoreAsync(IReadOnlyList<ClusterConfig> clusters, bool reconcileBackground, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
AttachHealthTracker(DestinationHealthTracker)
Declaration
public void AttachHealthTracker(DestinationHealthTracker tracker)
Parameters
|
Edit this page
View Source
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or
resetting unmanaged resources asynchronously.
Declaration
public ValueTask DisposeAsync()
Returns
| Type |
Description |
| ValueTask |
A task that represents the asynchronous dispose operation.
|
|
Edit this page
View Source
GetDestinationState(string)
Declaration
public DestinationState GetDestinationState(string destinationId)
Parameters
| Type |
Name |
Description |
| string |
destinationId |
|
Returns
| Type |
Description |
| DestinationState |
|
|
Edit this page
View Source
ReportHealthEvent(DestinationHealthEvent)
Publishes an event on behalf of a component that decides health outside the manager (a circuit breaker).
Declaration
public void ReportHealthEvent(DestinationHealthEvent healthEvent)
Parameters
| Type |
Name |
Description |
| DestinationHealthEvent |
healthEvent |
|
|
Edit this page
View Source
SetDestinationState(string, DestinationState)
Declaration
public void SetDestinationState(string destinationId, DestinationState state)
Parameters
| Type |
Name |
Description |
| string |
destinationId |
|
| DestinationState |
state |
|
|
Edit this page
View Source
TrySetDestinationState(string, DestinationState, DestinationState)
Atomically changes destinationId from expected to next.
Returns false when the current state is not expected. The default body is not atomic;
ClusterManager overrides it with compare-and-swap.
Declaration
public bool TrySetDestinationState(string destinationId, DestinationState expected, DestinationState next)
Parameters
| Type |
Name |
Description |
| string |
destinationId |
|
| DestinationState |
expected |
|
| DestinationState |
next |
|
Returns
Events
|
Edit this page
View Source
HealthEvent
Raised when a destination is ejected, recovers, or fails an active probe. Handlers run on the thread
that decided (a request, a probe round, or a circuit breaker), so they must be quick and must not throw.
Declaration
public event Action<DestinationHealthEvent>? HealthEvent
Event Type
| Type |
Description |
| Action<DestinationHealthEvent> |
|
Implements
Titanium.Web.Proxy.Abstractions.Routing.IClusterManager
Titanium.Web.Proxy.Abstractions.Plugins.IDestinationHealthEvents