ReorderWindow

data class ReorderWindow(val windowSize: Int, val seed: Long, val direction: Direction = Direction.Both) : FaultProfile

Buffer up to windowSize frames then emit them in a randomised order.

The window slides: once full it flushes all buffered frames in a seed-determined permutation, then starts filling again. direction controls which message stream is reordered.

seed guarantees determinism across test runs.

Each held outbound frame is flushed to its own destination: a sendTo frame to its peer, a broadcast frame to everyone. A held sendTo whose peer has left by the flush is dropped. Every held frame counts in FaultySeam.framesDelayed when it enters the window.

A partial window is released, or counted lost — never silently kept. Any FaultySeam.setFaultProfile (so heal() and partition() too) empties both windows and delivers what they held, in the order it arrived, each outbound frame to its own route. The release runs in the seam's scope because setFaultProfile cannot suspend, so a frame sent straight after the swap can arrive ahead of it. Frames still held when the seam closes, or when its link ends underneath it, count in FaultySeam.framesDropped — as does a released frame that finds the link already closed.

Constructors

Link copied to clipboard
constructor(windowSize: Int, seed: Long, direction: Direction = Direction.Both)

Properties

Link copied to clipboard
Link copied to clipboard
val seed: Long
Link copied to clipboard