Vixen
02b45cc4
csharp
public sealed class RealmCluster

The realm's half of the control plane. ADR-016 and ADR-018, wired.

Read the guide page for this →

Remarks

⚠ Every grain call in this file goes through RealmDirectory, and that is the whole point of the class. Doc 27 M1 names a grain call reaching the frame path as the single way this design fails — "it will not look like a bug, it will look like occasional stutter". So nothing here awaits: it posts, the realm keeps simulating, and the answer is applied on the realm's own thread at a defined point in a later frame.

⚠ The realm learns what to do from the replies it was already collecting. Draining arrives in the answer to a heartbeat; a lost lease arrives in the answer to a renewal. Nothing in the cluster calls into a realm, which means a realm needs no inbound port, no inbound authentication and no firewall rule beyond the one its players use.

⚠ A realm with no cluster is a realm, not a broken one. Doc 27 § Cost's L0 is a dedicated server with a lifecycle and no orchestrator; this class is what a deployment adds when it grows one, and RealmSpec.ClusterEndpoint being empty is the ordinary case rather than a misconfiguration.

Fields and properties (3)

  • public long HeartbeatCount

    How many heartbeats have been posted.

  • public int LeaseCount

    How many leases this realm believes it holds.

  • public long LeasesLost

    How many leases were taken away by somebody else.

Methods (3)

  • public RealmCluster(RealmHost host, IRealmGrains grains, RealmClusterOptions? options = null)

    Wires a realm to a cluster.

  • public void Update(TimeSpan elapsed)

    Renews what is held. Called once per realm update, after the host's own.

  • public void Dispose()

    Stops listening. Does not disconnect the cluster client, which it does not own.

Used by (1)

  • RealmClusterTestsVixen.Live.Realm.Cluster.Tests