SeamRaftTransport

Adapts a kuilt-core Seam to the RaftTransport interface.

This is the standard bridge between the kuilt fabric layer and the Raft consensus layer. It maps PeerIdNodeId by their string values and forwards sends and receives through the underlying Seam.

Peer reachability. peers reflects Seam.peers — nodes connected on the fabric, not necessarily all configured voters. A voter absent from the Seam is simply unreachable at the transport layer; the Raft engine handles this as an ordinary network partition.

Incoming filtering. Swatches with a null sender (e.g. broadcast frames from the fabric layer itself) are silently dropped; only frames with a known sender are forwarded as RaftEnvelopes.

This class is the only place in kuilt-raft that imports from kuilt-core. All other Raft types are transport-agnostic.

Constructors

Link copied to clipboard
constructor(seam: Seam)

Properties

Link copied to clipboard
open override val incoming: Flow<RaftEnvelope>

Hot flow of inbound RaftEnvelopes from other cluster members.

Link copied to clipboard
open val maxPayloadBytes: Int?

The maximum number of bytes a single sendTo payload can carry, or null if effectively unbounded (e.g. WebSocket). Fabrics with hard framing limits (e.g. ~32 KiB on some LAN radios) return that limit so kuilt-raft can size InstallSnapshot chunks to fit. Defaulted — existing transports need no change.

Link copied to clipboard
open override val peers: StateFlow<Set<NodeId>>

The set of peers currently reachable via this transport.

Link copied to clipboard
open override val selfId: NodeId

This node's own stable identifier. Must match its entry in ClusterConfig.

Functions

Link copied to clipboard
open suspend override fun sendTo(peer: NodeId, message: ByteArray)

Sends message to peer.