code wiki / _hdl_build / nx_gen_worker.nx

nx_gen_worker.nx

buildroot/runtime/_hdl_build/nx_gen_worker.nx

7233 B116 linesdepth 2pulls 2 transitivereach 7 importersview sourcekind librarytopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_worker.nx -- the GenWorker object: the GPU-worker CLIENT. Owns dispatch to a worker (a.b.c.d:port) for image gen (/v1/images/generations) and chat (/v1/chat/completions), plus the non-blocking TCP health-check that makes multi-worker availability-based selection + failover safe (a powered-off worker must never hang a dispatch). Extracted from nx_gen_orchestrator (monolith -> objects); behaviour-preserving. THIS is where ER-8 model-select-by- intent will land (route SFW->controlled model, explicit->turbo). Self-contained (private gw_* helpers). Object model: companion_arch.md. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_gen_worker.nx nx_gen_orchestrator.nx

imports: nx_syscalls.nx

imported by: nx_gen_orchestrator.nx

structs

none

consts

none

functions

9func gw_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o }
10func gw_catb(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var o: i64=off; var i: i64=0; while i<n {dst[o]=src[i]; o=o+1; i=i+1} return o }
11func gw_itoa(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var o: i64=off; var q: i64=k-1; while q>=0{dst[o]=t[q];o=o+1;q=q-1} return o }
14func go_worker_dispatch(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, body: *u8, blen: i64, respbuf: *u8, respcap: i64) -> i64
41func go_worker_img2img(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, body: *u8, blen: i64, respbuf: *u8, respcap: i64) -> i64
67func go_worker_up(ha: i64, hb: i64, hc: i64, hd: i64, port: i64) -> i64
95func go_chat_dispatch(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, body: *u8, blen: i64, respbuf: *u8, respcap: i64) -> i64