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).
holdDelivery — buffer all subsequent frames destined for to.
releaseDelivery — flush the hold queue for to in FIFO order and resume immediate delivery.
deliverNext — flush exactly one buffered frame to to; hold mode stays active.
bufferedCount — number of frames currently buffered for to.
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.
Functions
Number of frames currently buffered for to.
Flush exactly one buffered frame to to; hold mode remains active.
Start buffering frames destined for to rather than delivering them immediately.
Flush all buffered frames for to in FIFO order and resume immediate delivery.