Package-level declarations

Types

Link copied to clipboard

Who is a game's players talking through right now — the attachment directory.

Link copied to clipboard

A Raft learner-client that proposes commands through the cluster leader and exposes the committed log stream for state-machine application.

Link copied to clipboard
data class ClusterEndpoints(val endpoints: List<Tag>, val selector: EndpointSelector = RoundRobinEndpointSelector(startIndex = 0))

Configuration for a ClusterClient's endpoint rotation on transport tear.

Link copied to clipboard

One server's view of the two-tier overlay — the piece that survives a client's failover to a different server (slice 5D).

Link copied to clipboard

Deliver Raft messages to nodes that sit behind another server, without ever losing track of who really sent each one — the routed Raft transport.

Link copied to clipboard

Carry one per-recipient message to exactly one player who sits behind a different server — the cross-core routed unicast.

Link copied to clipboard
class VoterMesh

An M-voter Raft mesh — a complete-graph (K_M) cluster of voter RaftNodes.

Properties

Link copied to clipboard

The room-channel name an admitted client's app-unicast spoke rides on — the two-peer server↔client link a server hands to OverlayServer.admit as the local delivery seam for cross-core routed unicasts.

Functions

Link copied to clipboard
fun CoroutineScope.attachConnections(connectedPeers: StateFlow<Set<PeerId>>, overlay: OverlayServer, core: Set<PeerId>)

Keep an OverlayServer's attachment directory in step with a server's live client connections — the production, connection-layer form of "publish each connected player into the routing directory so the rest of the core relays to me".

Link copied to clipboard
fun attachmentDirectory(self: PeerId, interServerSeam: Seam, scope: CoroutineScope, clock: () -> Long, replica: ReplicaId = ReplicaId(interServerSeam.selfId.value), config: QuilterConfig = QuilterConfig()): AttachmentDirectory

Build an AttachmentDirectory for one server, replicating its attachments to the rest of the core over interServerSeam — the fully-meshed inter-server link. Each server calls this once with its own seam into the core.

Link copied to clipboard
fun CoroutineScope.clusterClient(loom: Loom, clusterEndpoints: ClusterEndpoints, clientNodeId: NodeId, clusterConfig: ClusterConfig, raftConfig: RaftConfig, identity: ClientIdentity = ClientIdentity.Auto, clock: () -> Instant): ClusterClient

Constructs a ClusterClient connected to the relay-room cluster.

Link copied to clipboard

Constructs a ClusterClient wrapping raftNode directly.

Link copied to clipboard
fun CoroutineScope.launchCoreLearnerAdmission(node: RaftNode, seam: Seam, core: Set<NodeId>)

Core-side learner admission for the server-core placement: whenever this node is the core leader and a connected session peer is neither a core voter nor already an admitted learner, commit a membership change adding it as a learner.

Link copied to clipboard
fun CoroutineScope.launchFederatedCoreAdmission(node: RaftNode, seam: Seam, rosterChannel: Seam, core: Set<NodeId>)

Cross-server learner admission for the federated server-core placement — the federated generalisation of launchCoreLearnerAdmission.

Link copied to clipboard
fun overlayServer(self: PeerId, coreSeam: Seam, directorySeam: Seam, scope: CoroutineScope, clock: () -> Long, directoryReplica: ReplicaId = ReplicaId(directorySeam.selfId.value), directoryConfig: QuilterConfig = QuilterConfig()): OverlayServer

Build an OverlayServer for one server, wiring its AttachmentDirectory and RoutedUnicastRouter together over the two inter-server channels.

Link copied to clipboard
fun playerRelayTransport(inner: RaftTransport, relayChannel: Seam, voters: () -> Set<NodeId>, scope: CoroutineScope): RoutedRaftTransport

Build a RoutedRaftTransport for a player: it always forwards to its single server and never routes for anyone else. Required even single-server — without it a learner's reply, handed raw to a follower server, is dropped or answered NotLeader, wedging the commit path.

Link copied to clipboard
fun routedUnicastRouter(self: PeerId, coreSeam: Seam, lookup: (PeerId) -> PeerId?, scope: CoroutineScope): RoutedUnicastRouter

Build a RoutedUnicastRouter for one server, taking sole ownership of coreSeam's incoming for the routing relay.

Link copied to clipboard
fun serverRelayTransport(inner: RaftTransport, relayChannel: Seam, core: Set<NodeId>, scope: CoroutineScope, attachment: (NodeId) -> NodeId?): RoutedRaftTransport

Build a RoutedRaftTransport for a core server: it may take one core hop to reach a player behind another server, choosing that hop from attachment.

Link copied to clipboard
fun voterMeshFromNodes(voterNodes: Map<NodeId, RaftNode>, scope: CoroutineScope): VoterMesh

Construct a VoterMesh from pre-built voter nodes.

Link copied to clipboard
fun CoroutineScope.voterMeshOverSeams(voterSeams: Map<NodeId, Seam>, raftConfig: RaftConfig, storageFactory: (NodeId) -> RaftStorage = { InMemoryRaftStorage() }): VoterMesh

Wire M voter us.tractat.kuilt.raft.RaftNodes over real Seams into a VoterMesh.