import { Script } from "./twins.js"; //#region src/scripts/registry.d.ts /** * KEYS: workers, ns_workers, client config, bindings, bindepochs, client metadata * ARGV: recordJson (sans draining/expiry), now(ms), leaseTtlMs, * selfDraining('1'/'0'), epoch * Bucket-0 register: prunes long-dead workers (GC'ing unreferenced bindings * and their epoch entries), check-or-sets the per-namespace (hostname, ns)/env * bindings — a higher epoch displaces a disagreeing binding, quarantining the * (hostname, ns) for one lease — computes draining/expiry against the drain * config, writes the record, and rewrites its ns lists. * Returns ['ok', recordRaw, epochEntriesJson] — mirrors write both verbatim — * or ['conflict', message] when a binding disagrees at an equal or higher epoch. */ declare const registerScript: Script.Def; /** * KEYS: workers, ns_workers, bindings, bindepochs * ARGV: recordRaw (as returned by register), now(ms), leaseTtlMs, * epochEntriesJson (as returned by register) * Buckets 1..S-1: writes the bucket-0 record, bindings, and binding-epoch * entries byte-for-byte, rewrites its ns lists, prunes long-dead workers. */ declare const mirrorScript: Script.Def; /** * KEYS: workers, ns_workers, bindings, bindepochs * ARGV: recordRaw (refreshed record), now(ms), entriesJson (''=bucket 0) * Per-bucket heartbeat refresh: writes the record and ensures the session's * ns-list membership, so a bucket added by a shard-count raise serves without * re-register. Bucket 0 returns its {bindings, epochs} for the record's * fields; buckets 1..S-1 fill absent bindings from them (first writer wins — * a disagreeing binding and its epoch entry are left untouched; displacement * stays register-only). */ declare const heartbeatScript: Script.Def; /** * KEYS: workers, ns_workers, bindings, bindepochs * ARGV: now(ms), leaseTtlMs * Bucket sweep: prunes long-dead workers (and their unreferenced bindings and * epoch entries), rewrites every ns_workers field against the survivors, and * returns the clientIds seen, pruned ones included, for drain-config GC. */ declare const gcScript: Script.Def; /** * KEYS: ns_workers, workers * ARGV: field (`${hostname}${ns}`), sessionId, op('add'/'remove'), now(ms) * Rewrites one ns_workers field, pruning sessionIds whose worker is absent * or expired. */ declare const nsWorkersScript: Script.Def; //#endregion export { gcScript, heartbeatScript, mirrorScript, nsWorkersScript, registerScript }; //# sourceMappingURL=registry.d.ts.map