NodeChange

sealed interface NodeChange(source)

A delta notification of node state changes.

The SDK emits these via the RadioClient.nodes flow. Late subscribers first receive a Snapshot of all known nodes, then live deltas (Added, Updated, Removed) in causal order.

This delta-based design is efficient for large meshes: a 200-node network with frequent telemetry would be wasteful to emit as a full StateFlow<Map<NodeId, NodeInfo>> (200 entries per update). Deltas are O(1) space; subscribers can fold to a StateFlow if they prefer.

Since

0.1.0

Inheritors

Types

Link copied to clipboard
data class Added(val node: NodeInfo) : NodeChange

A new node joined the mesh or was discovered by the local node.

Link copied to clipboard
data class Removed(val nodeId: NodeId) : NodeChange

A node was removed from the mesh (typically after a timeout or manual removal).

Link copied to clipboard
data class Snapshot(val nodes: Map<NodeId, NodeInfo>) : NodeChange

All known nodes at subscription time.

Link copied to clipboard
data class Updated(val node: NodeInfo, val changed: Set<NodeField>) : NodeChange

An existing node's information changed.