ControllableLoom

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

All control methods are non-suspending and safe to call from a runTest body (queues are flushed synchronously without a dispatcher).

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()

Functions

Link copied to clipboard
open override fun availability(): FabricAvailability
Link copied to clipboard

Number of frames currently buffered for to.

Link copied to clipboard

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

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