Quilted

interface Quilted<S : Quilted<S>>

A delta-state CRDT: a value living in a join-semilattice.

piece is the join — the least-upper-bound of two states. It MUST satisfy the three lattice laws:

  • idempotent a.piece(a) == a

  • commutative a.piece(b) == b.piece(a)

  • associative a.piece(b).piece(c) == a.piece(b.piece(c))

These laws are exactly what make convergence robust to kuilt's frame delivery semantics: a fabric may drop, duplicate, and reorder frames, but any two replicas that have absorbed the same set of states — in any order, with any repeats — compute the same value.

Operations are modeled as delta-mutators that return a Patch (a small fragment of the same lattice), which any replica absorbs with piece. The name nods to kuilt's quilting metaphor: a whole pieced from independent patches.

Type Parameters

S

the self-type — implementors write class Foo : Quilted<Foo>.

Inheritors

Functions

Link copied to clipboard
open fun causalDots(): Set<Dot>

The causal Dots this state has delivered — (author, author-seq) per op.

Link copied to clipboard
abstract fun piece(other: S): S

The join: the least-upper-bound of this and other.