ConsensusPlacement

Where a game session's consensus authority lives — an injectable, bootstrap-time choice.

Every bootstrap entry point (gameNode, gameHost, gameJoin, gameSpectate, gameHosted) obtains its RaftNode through a placement instead of constructing one internally. The session-consuming layer — TurnSequencer, GameSession.appChannel, Quilter riding an app channel — is identical regardless of which placement is injected; only where quorum lives changes:

  • SessionOwned (the default): consensus lives among the session's own peers. This is today's behaviour, byte-for-byte — the appoint-the-host path grows voters from joiners, the roster-given path seats the known roster.

  • serverCore: consensus lives on a fixed core of server nodes, all of which vote in every game; session peers ride as learners. Bootstrap via gameNode.

  • preBuilt: the session drives a node the caller already constructed — the seam that lets a consumer bootstrap the full game stack against a test double (e.g. a FakeRaftNode pinned to Leader) under pure virtual time, with no real Raft engine anywhere.

A future gameId-sharded placement (hash the game id onto k of M core nodes) is another AuthoritySeating.CoreVoters instance with a narrower core — it slots in behind this interface without touching session-consuming code.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Which peers hold voter seats under this placement.

Functions

Link copied to clipboard
open fun launchAdmission(scope: CoroutineScope, node: RaftNode, binding: ConsensusBinding, seam: Seam)

Launch this placement's learner-admission policy on scope, if it has one.

Link copied to clipboard
abstract fun node(scope: CoroutineScope, binding: ConsensusBinding): RaftNode

Build — or hand over — the RaftNode whose log this session drives.