lattice_crdt

Umbrella package for Lattice CRDTs: counters, registers, sets, maps, and causal core types.

Install this package when you want the full Lattice CRDT toolkit. For smaller dependency graphs, install the individual packages directly.

Installation

gleam add lattice_crdt

Packages included

PackageProvides
lattice_coreReplica IDs, version vectors, and dot contexts.
lattice_countersGrow-only and positive-negative counters.
lattice_registersLast-writer-wins and multi-value registers.
lattice_setsGrow-only, two-phase, and observed-remove sets.
lattice_mapsLast-writer-wins maps, observed-remove maps, and CRDT dispatch.

Quick example

import lattice_core/replica_id
import lattice_counters/g_counter

pub fn main() {
  let counter =
    g_counter.new(replica_id.new("node-a"))
    |> g_counter.increment(1)

  g_counter.value(counter)
  // -> 1
}

Notes

Links

License

MIT

Search Document