code wiki / _hdl_build / nx_consul_kv.nx

nx_consul_kv.nx

buildroot/runtime/_hdl_build/nx_consul_kv.nx

2042 B40 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic consul
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_consul_kv.nx nx_consul_kv_test.nx nx_consul_suite_test.nx

imports: nx_syscalls.nx

imported by: nx_consul_kv_test.nxnx_consul_suite_test.nx

structs

none

consts

none

functions

9func ckv_get(keys: *i64, present: *i64, n: i64, key: i64) -> i64
called by 3: ckv_putckv_casmain
16func ckv_put(keys: *i64, vals: *i64, vers: *i64, present: *i64, n: i64, key: i64, val: i64) -> i64
called by 3: ckv_casmainmain calls 1: ckv_get
29func ckv_cas(keys: *i64, vals: *i64, vers: *i64, present: *i64, n: i64, key: i64, val: i64, expected: i64) -> i64
called by 2: mainmain calls 2: ckv_getckv_put
40func ckv_delete(present: *i64, idx: i64) -> i64 { if idx >= 0 { present[idx] = 0 } return 0 }
called by 1: main