code wiki / _hdl_build / nx_consul_kv.nx
nx_consul_kv.nx
buildroot/runtime/_hdl_build/nx_consul_kv.nx
about
nx_consul_kv.nx -- sovereign KEY-VALUE store with COMPARE-AND-SWAP (HashiCorp Consul KV-class; CONSUL-002).
Each key carries a per-key version (Consul's ModifyIndex) that bumps on every modify. CAS applies a write
ONLY if the caller's expected version matches the current one (optimistic concurrency) -- this is the
primitive distributed LOCKS and leader-election are built on (a stale writer is rejected, never clobbers).
Pure logic over fixed-slot arrays. license_tier: ORIGINAL (composes into the sovereign-Consul arc)
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_consul_kv_test.nxnx_consul_suite_test.nx
structs
| none |
consts
| none |
functions
| 9 | func ckv_get(keys: *i64, present: *i64, n: i64, key: i64) -> i64 |
| 16 | func ckv_put(keys: *i64, vals: *i64, vers: *i64, present: *i64, n: i64, key: i64, val: i64) -> i64 |
| 29 | func ckv_cas(keys: *i64, vals: *i64, vers: *i64, present: *i64, n: i64, key: i64, val: i64, expected: i64) -> i64 |
| 40 | func ckv_delete(present: *i64, idx: i64) -> i64 { if idx >= 0 { present[idx] = 0 } return 0 } called by 1: main |