Package-level declarations

Types

Link copied to clipboard
sealed interface CloseReason

Reason a Seam is being closed. Designed as a forward-compatible sealed hierarchy — new variants can be added without breaking existing when exhaustiveness because the common cases are covered.

Link copied to clipboard

Which direction a fault applies to.

Link copied to clipboard
sealed interface FabricAvailability

Whether a Loom's underlying transport fabric can be attempted on this runtime. A fabric scoped out by target (e.g. WebRTC only present on wasmJs) is simply absent — not Unavailable. Unavailable means present-but-not-usable-now.

Link copied to clipboard
sealed interface FaultProfile

Declarative description of which faults FaultySeam should inject.

Link copied to clipboard
class FaultyLoom(delegate: Loom, scope: CoroutineScope, defaultProfile: FaultProfile = FaultProfile.Healthy) : Loom

A Loom wrapper that constructs FaultySeam instances.

Link copied to clipboard
class FaultySeam(delegate: Seam, scope: CoroutineScope, initialProfile: FaultProfile = FaultProfile.Healthy) : Seam

A Seam wrapper that injects configurable faults for use in tests.

Link copied to clipboard
class FlakyLifecycleLoom(delegate: Loom, scope: CoroutineScope) : Loom

A Loom wrapper that produces FlakyLifecycleSeam instances.

Link copied to clipboard
class FlakyLifecycleSeam(delegate: Seam, scope: CoroutineScope) : Seam

A Seam wrapper that owns its own state and gates the contract on it, enabling lifecycle-flap scenarios in tests.

Link copied to clipboard
data class FlapSchedule(val seed: Long, val meanUptime: Duration, val meanDowntime: Duration, val giveUpAfter: Int)

Declarative soak driver for FlakyLifecycleSeam.drive.

Link copied to clipboard

In-memory implementation of Loom for use in tests and integration harnesses. All Seam instances produced by the same factory instance share a single in-memory mesh.

Link copied to clipboard
data class InMemoryTag(val displayName: String, val peerKey: String = displayName) : Tag

A Tag implementation for the in-memory transport. Since the in-memory factory does not need network discovery, this carries only the display name. The factory itself provides the mesh context.

Link copied to clipboard
interface Loom

Establishes a Seam in the role of either an existing-session joiner or a new-session opener. The factory hides discovery (mDNS, MultipeerConnectivity advertising, WebSocket URL).

Link copied to clipboard
class MuxSeam(delegate: Seam, scope: CoroutineScope)

N-way multiplexer over a Seam.

Link copied to clipboard
class NamedMux(delegate: Seam, scope: CoroutineScope)

String-keyed multiplexer over a Seam — the unbounded-namespace sibling of MuxSeam.

Link copied to clipboard
data class Pattern(val displayName: String, val maxPeers: Int = 6)

Configuration for opening a new peer session.

Link copied to clipboard
@Serializable
value class PeerId(val value: String)

Stable, comparable identifier for one peer within one session.

Link copied to clipboard

Thrown by Seam.sendTo when the addressed peer is not in Seam.peers.

Link copied to clipboard
value class PlyId(val value: String)

Stable identity of one constituent link ("ply") within a composite fabric.

Link copied to clipboard
sealed interface Rendezvous

Describes the role a Loom peer takes when weaving a session.

Link copied to clipboard
abstract class ScopedCloseable(parentScope: CoroutineScope) : AutoCloseable

Base for coordinators that launch coroutines into an owned child scope and implement AutoCloseable.

Link copied to clipboard
interface Seam

One peer's view of a multi-peer session.

Link copied to clipboard
sealed interface SeamState

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

Link copied to clipboard
class Swatch

Opaque message moving between peers. The wire layer does not interpret the bytes; that is the consumer's job.

Link copied to clipboard
interface Tag

Game-agnostic discovery handle. mDNS service record / MPC peer / WS URL.

Functions

Link copied to clipboard
fun checkNotUnderTestDispatcher(scope: CoroutineScope, typeName: String, substitute: String, strict: Boolean, expectVirtualTime: Boolean)

Emits a warning (or throws, when strict is true) if scope contains a kotlinx.coroutines.test.TestDispatcher.

Link copied to clipboard
inline fun <R> runCatchingCancellable(block: () -> R): Result<R>

Like runCatching but never swallows coroutine cancellation: a CancellationException always propagates, so a cancelled coroutine fails fast instead of being reported as a captured failure. Every other Throwable becomes Result.failure.