콘텐츠로 이동
한국어

ClusterSubscriptionReplayMode

이 콘텐츠는 아직 번역되지 않았습니다.

ClusterSubscriptionReplayMode = "events" | "snapshot"

Defined in: src/cluster/Cluster.ts:103

How Cluster.subscribe states the membership that already exists when a listener attaches (#161).

  • 'events' (default) — the current membership as the events that would have built it: one MemberJoined per member, followed by the status event that member has already reached, then LeaderChanged. A listener written for the live stream handles the replay with the same code and needs no initial-state branch.
  • 'snapshot' — one CurrentClusterState, whatever the cluster’s size. Pick it when the listener wants to know where things stand rather than to re-live how they got there: it is one callback instead of one per member, and it marks where the replay ends, which the event form cannot.

The default stays 'events' because it is what every existing subscriber was written against, not because it is the better choice for new code.