Quilter
Parameters
this peer's ReplicaId.
the Seam to ride. Collect Seam.incoming exactly once — this class takes sole ownership of the incoming stream.
the starting state (typically the CRDT's zero/empty value).
a KSerializer for QuiltMessage<S>, obtained via QuiltMessage.serializer(stateSerializer).
the CoroutineScope whose Job becomes the parent of the replicator's owned child job. In tests, pass backgroundScope from kotlinx.coroutines.test.TestScope so infinite-running collectors are cancelled cleanly at test end without raising kotlinx.coroutines.test.UncompletedCoroutinesError.
replication behaviour tuning (eviction TTL, anti-entropy interval).
monotonic time source; override in tests to inject a fake clock.
Test-dispatcher guard. If the scope contains a kotlinx.coroutines.test.TestDispatcher, a diagnostic is emitted because runAntiEntropy uses real-clock kotlinx.coroutines.delay — under virtual time those delays never advance automatically, causing tests to deadlock silently. Either use UnconfinedTestDispatcher (delays execute eagerly) or advance virtual time via testScheduler.advanceTimeBy(…) if you must use StandardTestDispatcher. Set QuilterConfig.strictTestGuard to true to throw rather than warn.