AdoptRole

sealed interface AdoptRole

Which side of a room an SeamRoomFactory.adopt takes, and what that side needs.

A host decides who comes in, so it carries the HostAdmission it decides with, and the room's identity when the caller supplies one. A joiner decides nothing and learns the room's identity from the host's Welcome, so it carries neither. That is a type rather than a check: a joiner cannot be handed a policy it would never ask, or a room id it is not entitled to choose.

Inheritors

Types

Link copied to clipboard
data class Host(val admission: HostAdmission, val roomId: RoomId? = null) : AdoptRole

Host the room: this peer admits the others.

Link copied to clipboard
data object Joiner : AdoptRole

Join the room: the host admits this peer.