PartitionEvent

sealed interface PartitionEvent

An event emitted by PartitionDetector describing a peer's reachability state change.

The event hierarchy is intentionally role-agnostic: there is no distinction between "host" and "joiner" here. Any leader-election protocol (explicit handoff or automatic election) consumes the same PartitionEvent stream without re-plumbing the detection layer.

Reserved heartbeat frame namespace: kuilt.heartbeat.ping / kuilt.heartbeat.pong. Applications must not emit frames with these namespaces; they are consumed exclusively by HeartbeatPartitionDetector.

The runtime is responsible for calling PartitionDetector.observedPeer whenever any frame (including application frames) arrives from a peer. App-layer frames reset the timeout just as pong frames do — heartbeat is a dead-man's switch, not a dedicated keepalive channel.

Inheritors

Types

Link copied to clipboard
data class PeerLost(val peerId: PeerId, val at: Instant) : PartitionEvent

The HeartbeatConfig.reconnectWindow expired without recovery.

Link copied to clipboard
data class PeerRecovered(val peerId: PeerId, val at: Instant) : PartitionEvent

A previously unresponsive peer has resumed sending frames before the HeartbeatConfig.reconnectWindow expired.

Link copied to clipboard
data class PeerUnresponsive(val peerId: PeerId, val at: Instant, val reason: PartitionEvent.Reason) : PartitionEvent

The peer has stopped responding within HeartbeatConfig.timeout.

Link copied to clipboard

The source of a PeerUnresponsive signal.

Properties

Link copied to clipboard
abstract val at: Instant
Link copied to clipboard
abstract val peerId: PeerId