SeamState

sealed interface SeamState

One peer's view of whether the fabric can carry frames.

Orthogonal to Seam.peers: Woven with peers == {selfId} is a fully legitimate, well-defined state — the fabric is live and this peer is simply alone in the session. "Can I inject frames" (this) and "who can I reach" (peers) are different questions.

Lifecycle: Weaving → Woven → Torn(reason). Woven → Weaving is permitted if a fabric supports re-establishment; Torn is terminal.

Inheritors

Types

Link copied to clipboard
data class Torn(val reason: CloseReason) : SeamState

Terminal. The fabric is gone; reason says why.

Link copied to clipboard
data object Weaving : SeamState

The fabric is forming. Sends may reach no one and must not be relied on.

Link copied to clipboard
data object Woven : SeamState

The fabric is live. Frames broadcast now are carried to the current peers.