DelayedWovenLoom

class DelayedWovenLoom(policy: DeliveryPolicy = DeliveryPolicy.Reliable) : Loom

A test Loom whose Seams start in SeamState.Weaving and only transition to SeamState.Woven when DelayedWovenSeam.markWoven is called explicitly.

This harness reproduces the radio-fabric timing window — the state where weave() has returned but the fabric link is not yet live — in a fully deterministic, in-memory environment. Use it to verify that consumers (e.g. SeamRoom) correctly await SeamState.Woven before transmitting, rather than assuming the seam is live immediately after weave() returns.

Usage

val loom = DelayedWovenLoom()
val seam = loom.host(pattern) // state == Weaving
// ... seam is Weaving here ...
(seam as DelayedWovenSeam).markWoven() // state → Woven

Frame routing is in-memory. broadcast and sendTo deliver frames to all other seams on the same loom regardless of SeamState — this lets tests inspect whether frames sent while SeamState.Weaving ever arrive.

Inbound delivery is bounded and backpressured via one Spool per receiver, with overflow behaviour chosen by policy (default DeliveryPolicy.Reliable).

Constructors

Link copied to clipboard
constructor(policy: DeliveryPolicy = DeliveryPolicy.Reliable)

Properties

Link copied to clipboard

Test hook: the seams woven by this loom, in weave order.

Functions

Link copied to clipboard
Link copied to clipboard
open override fun capability(): TransportCapability
Link copied to clipboard
open suspend fun host(pattern: Pattern): Seam
Link copied to clipboard
open suspend fun join(tag: Tag): Seam
Link copied to clipboard
open suspend override fun weave(rendezvous: Rendezvous): Seam