MemberMetadata

Per-member display names tracked with last-writer-wins semantics, backed by LWWMap.

Each member can set their own display name. Concurrent writes from different replicas resolve by (timestamp, replicaId) — the higher-timestamp write wins; when timestamps tie, the higher ReplicaId value (lexicographic) wins, giving a deterministic but arbitrary outcome.

Immutable value type

Every mutating operation returns a new MemberMetadata — the receiver is not modified. Wire the return value back into your state holder.

Clock-skew warning

This type inherits LWWMap's clock-skew caveat: wall-clock timestamps work only when clocks are well-synchronized across all replicas. Prefer a Hybrid Logical Clock above this layer when clock drift is a concern.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

All currently-set display names, keyed by PeerId.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Merge another replica's metadata into this one.

Link copied to clipboard
fun set(peer: PeerId, displayName: String, timestamp: Long, replica: ReplicaId): MemberMetadata

Set a display name for peer tagged with (timestamp, replica).

Link copied to clipboard
open override fun toString(): String