ControllableLoom

class ControllableLoom(val policy: DeliveryPolicy = DeliveryPolicy.Reliable) : Loom

A drop-in replacement for us.tractat.kuilt.core.InMemoryLoom with controllable per-peer delivery for deterministic concurrency testing.

By default every frame fans out immediately — identical to us.tractat.kuilt.core.InMemoryLoom. When a peer is held, outbound frames addressed to that peer are buffered locally and not forwarded to its incoming until releaseDelivery or deliverNext is called.

This lets tests script interleavings that the atomic InMemoryLoom.dispatch cannot express — for example: peer A acts on local state while peer C's concurrent frame is held, then release C's frames to observe late-delivery convergence.

Control surface

Peers and IDs

Peers join by calling weave (or the host/join shortcuts). The selfId for a Rendezvous.New is taken from the us.tractat.kuilt.core.Pattern's displayName (or auto-generated as peer-N when blank). Rendezvous.Existing uses the tag's displayName the same way.

Constructors

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

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard

Number of frames currently buffered for to.

Link copied to clipboard
open override fun capability(): TransportCapability
Link copied to clipboard
suspend fun deliverNext(to: PeerId): Boolean

Flush exactly one buffered frame to to; hold mode remains active.

Link copied to clipboard

Start buffering frames destined for to rather than delivering them immediately.

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
suspend fun releaseDelivery(to: PeerId)

Flush all buffered frames for to in FIFO order and resume immediate delivery.

Link copied to clipboard
open suspend override fun weave(rendezvous: Rendezvous): ControllableSeam