跳转到内容
简体中文

CurrentClusterState

此内容尚不支持你的语言。

Defined in: src/cluster/ClusterEvents.ts:51

The cluster as it stands at the moment of subscription — the single event a replayMode: 'snapshot' subscriber receives before the live stream starts (#161).

The other replay form ('events', still the default) states the same membership as the events that would have produced it: one MemberJoined per member plus the status event each has already reached. That form suits a listener that only reacts to deltas, because it needs no separate initial-state branch; it costs one callback per member, and it never says where the replay ends. This one is the opposite trade, and the reason it exists.

unreachable is a subset of members, not a disjoint set: an unreachable peer is still a member, and excluding it would make members.length mean something different depending on the cluster’s health.

There is no seenBy. Akka’s is the set of members that have observed the current gossip version, which presumes a versioned whole; gossip here merges member records individually, so there is no such version to have been seen.

Never published on the event stream: it describes one subscriber’s starting point, not something that happened to the cluster.

new CurrentClusterState(members, unreachable, leader): CurrentClusterState

Defined in: src/cluster/ClusterEvents.ts:52

readonly Member[]

Every current member — tombstones excluded — in address order.

readonly Member[]

The members of members whose status is unreachable.

Option<Member>

CurrentClusterState

readonly leader: Option<Member>

Defined in: src/cluster/ClusterEvents.ts:57


readonly members: readonly Member[]

Defined in: src/cluster/ClusterEvents.ts:54

Every current member — tombstones excluded — in address order.


readonly unreachable: readonly Member[]

Defined in: src/cluster/ClusterEvents.ts:56

The members of members whose status is unreachable.