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

Package Provides
lattice_core Replica IDs, version vectors, and dot contexts.
lattice_counters Grow-only and positive-negative counters.
lattice_registers Last-writer-wins and multi-value registers.
lattice_sets Grow-only, two-phase, and observed-remove sets.
lattice_maps Last-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